From a02ee3a08bac55c9f0b29cb6bc0a15726b7cc3c8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 8 Apr 2018 03:58:11 +0900 Subject: [PATCH] Some bug fixes --- src/client/app/common/define-widget.ts | 4 +- src/client/app/common/mios.ts | 10 +- .../app/common/scripts/streaming/drive.ts | 2 +- .../app/common/scripts/streaming/home.ts | 4 +- .../scripts/streaming/messaging-index.ts | 2 +- .../app/common/scripts/streaming/messaging.ts | 4 +- .../common/scripts/streaming/othello-game.ts | 2 +- .../app/common/scripts/streaming/othello.ts | 2 +- .../app/common/views/components/signin.vue | 4 +- .../views/components/twitter-setting.vue | 12 +- .../app/common/views/components/uploader.vue | 2 +- src/client/app/desktop/api/update-avatar.ts | 2 +- src/client/app/desktop/api/update-banner.ts | 2 +- .../app/desktop/views/components/home.vue | 25 +- .../desktop/views/components/note-detail.vue | 4 +- .../desktop/views/components/notes.note.vue | 27 +- .../desktop/views/components/post-detail.vue | 4 +- .../desktop/views/components/posts.post.vue | 6 +- .../desktop/views/components/settings.2fa.vue | 8 +- .../desktop/views/components/settings.api.vue | 2 +- .../views/components/settings.profile.vue | 8 +- .../app/desktop/views/components/settings.vue | 12 +- .../app/desktop/views/components/timeline.vue | 2 +- .../desktop/views/components/ui.header.vue | 8 +- .../views/components/widget-container.vue | 4 +- .../app/desktop/views/components/window.vue | 4 +- .../desktop/views/pages/user/user.header.vue | 2 +- .../desktop/views/pages/user/user.home.vue | 2 +- .../desktop/views/pages/user/user.profile.vue | 10 +- .../mobile/views/components/note-detail.vue | 4 +- .../app/mobile/views/components/note.vue | 32 +- .../mobile/views/components/post-detail.vue | 462 --------------- .../app/mobile/views/components/post-form.vue | 2 +- .../app/mobile/views/components/post.vue | 540 ------------------ .../app/mobile/views/components/ui.header.vue | 4 +- src/client/app/mobile/views/pages/home.vue | 20 +- .../mobile/views/pages/profile-setting.vue | 4 +- src/client/app/mobile/views/pages/user.vue | 10 +- .../app/mobile/views/pages/user/home.vue | 2 +- src/client/app/mobile/views/pages/welcome.vue | 4 +- src/models/user.ts | 106 ++-- src/queue/processors/http/process-inbox.ts | 4 +- src/remote/activitypub/act/create/image.ts | 2 +- src/remote/activitypub/act/create/index.ts | 2 +- src/remote/activitypub/act/delete/index.ts | 2 +- src/remote/activitypub/act/undo/index.ts | 2 +- src/remote/activitypub/renderer/follow.ts | 2 +- src/remote/activitypub/renderer/key.ts | 2 +- src/remote/request.ts | 7 +- src/renderers/get-user-summary.ts | 3 +- src/server/api/authenticate.ts | 2 +- src/server/api/bot/core.ts | 2 +- src/server/api/bot/interfaces/line.ts | 10 +- src/server/api/common/signin.ts | 2 +- src/server/api/endpoints/following/create.ts | 2 +- src/server/api/endpoints/following/delete.ts | 2 +- src/server/api/endpoints/i.ts | 8 +- src/server/api/endpoints/i/2fa/done.ts | 4 +- src/server/api/endpoints/i/2fa/register.ts | 2 +- src/server/api/endpoints/i/2fa/unregister.ts | 6 +- src/server/api/endpoints/i/change_password.ts | 4 +- .../api/endpoints/i/regenerate_token.ts | 4 +- src/server/api/endpoints/i/update.ts | 14 +- .../api/endpoints/i/update_client_setting.ts | 4 +- src/server/api/endpoints/i/update_home.ts | 6 +- .../api/endpoints/i/update_mobile_home.ts | 6 +- src/server/api/endpoints/mute/create.ts | 2 +- src/server/api/endpoints/mute/delete.ts | 2 +- src/server/api/endpoints/notes/polls/vote.ts | 2 +- .../api/endpoints/users/recommendation.ts | 2 +- src/server/api/private/signin.ts | 10 +- src/server/api/private/signup.ts | 55 +- src/server/api/service/twitter.ts | 10 +- src/server/api/stream/home.ts | 2 +- src/server/api/streaming.ts | 2 +- src/services/following/create.ts | 4 +- src/services/following/delete.ts | 2 +- src/services/note/create.ts | 10 +- src/services/note/reaction/create.ts | 4 +- test/api.ts | 16 +- tools/migration/nighthike/12.js | 58 ++ 81 files changed, 337 insertions(+), 1318 deletions(-) delete mode 100644 src/client/app/mobile/views/components/post-detail.vue delete mode 100644 src/client/app/mobile/views/components/post.vue create mode 100644 tools/migration/nighthike/12.js diff --git a/src/client/app/common/define-widget.ts b/src/client/app/common/define-widget.ts index 9f8dcfc7e..7b98c0903 100644 --- a/src/client/app/common/define-widget.ts +++ b/src/client/app/common/define-widget.ts @@ -56,14 +56,14 @@ export default function(data: { id: this.id, data: newProps }).then(() => { - (this as any).os.i.account.clientSettings.mobileHome.find(w => w.id == this.id).data = newProps; + (this as any).os.i.clientSettings.mobileHome.find(w => w.id == this.id).data = newProps; }); } else { (this as any).api('i/update_home', { id: this.id, data: newProps }).then(() => { - (this as any).os.i.account.clientSettings.home.find(w => w.id == this.id).data = newProps; + (this as any).os.i.clientSettings.home.find(w => w.id == this.id).data = newProps; }); } }, { diff --git a/src/client/app/common/mios.ts b/src/client/app/common/mios.ts index 48e830810..fd267bc3f 100644 --- a/src/client/app/common/mios.ts +++ b/src/client/app/common/mios.ts @@ -270,7 +270,7 @@ export default class MiOS extends EventEmitter { // Parse response res.json().then(i => { me = i; - me.account.token = token; + me.token = token; done(); }); }) @@ -294,12 +294,12 @@ export default class MiOS extends EventEmitter { const fetched = me => { if (me) { // デフォルトの設定をマージ - me.account.clientSettings = Object.assign({ + me.clientSettings = Object.assign({ fetchOnScroll: true, showMaps: true, showPostFormOnTopOfTl: false, gradientWindowHeader: false - }, me.account.clientSettings); + }, me.clientSettings); // ローカルストレージにキャッシュ localStorage.setItem('me', JSON.stringify(me)); @@ -329,7 +329,7 @@ export default class MiOS extends EventEmitter { fetched(cachedMe); // 後から新鮮なデータをフェッチ - fetchme(cachedMe.account.token, freshData => { + fetchme(cachedMe.token, freshData => { merge(cachedMe, freshData); }); } else { @@ -437,7 +437,7 @@ export default class MiOS extends EventEmitter { } // Append a credential - if (this.isSignedIn) (data as any).i = this.i.account.token; + if (this.isSignedIn) (data as any).i = this.i.token; // TODO //const viaStream = localStorage.getItem('enableExperimental') == 'true'; diff --git a/src/client/app/common/scripts/streaming/drive.ts b/src/client/app/common/scripts/streaming/drive.ts index f11573685..7ff85b594 100644 --- a/src/client/app/common/scripts/streaming/drive.ts +++ b/src/client/app/common/scripts/streaming/drive.ts @@ -8,7 +8,7 @@ import MiOS from '../../mios'; export class DriveStream extends Stream { constructor(os: MiOS, me) { super(os, 'drive', { - i: me.account.token + i: me.token }); } } diff --git a/src/client/app/common/scripts/streaming/home.ts b/src/client/app/common/scripts/streaming/home.ts index c19861940..e085801e1 100644 --- a/src/client/app/common/scripts/streaming/home.ts +++ b/src/client/app/common/scripts/streaming/home.ts @@ -10,13 +10,13 @@ import MiOS from '../../mios'; export class HomeStream extends Stream { constructor(os: MiOS, me) { super(os, '', { - i: me.account.token + i: me.token }); // 最終利用日時を更新するため定期的にaliveメッセージを送信 setInterval(() => { this.send({ type: 'alive' }); - me.account.lastUsedAt = new Date(); + me.lastUsedAt = new Date(); }, 1000 * 60); // 自分の情報が更新されたとき diff --git a/src/client/app/common/scripts/streaming/messaging-index.ts b/src/client/app/common/scripts/streaming/messaging-index.ts index 24f0ce0c9..84e2174ec 100644 --- a/src/client/app/common/scripts/streaming/messaging-index.ts +++ b/src/client/app/common/scripts/streaming/messaging-index.ts @@ -8,7 +8,7 @@ import MiOS from '../../mios'; export class MessagingIndexStream extends Stream { constructor(os: MiOS, me) { super(os, 'messaging-index', { - i: me.account.token + i: me.token }); } } diff --git a/src/client/app/common/scripts/streaming/messaging.ts b/src/client/app/common/scripts/streaming/messaging.ts index 4c593deb3..c1b5875cf 100644 --- a/src/client/app/common/scripts/streaming/messaging.ts +++ b/src/client/app/common/scripts/streaming/messaging.ts @@ -7,13 +7,13 @@ import MiOS from '../../mios'; export class MessagingStream extends Stream { constructor(os: MiOS, me, otherparty) { super(os, 'messaging', { - i: me.account.token, + i: me.token, otherparty }); (this as any).on('_connected_', () => { this.send({ - i: me.account.token + i: me.token }); }); } diff --git a/src/client/app/common/scripts/streaming/othello-game.ts b/src/client/app/common/scripts/streaming/othello-game.ts index f34ef3514..b85af8f72 100644 --- a/src/client/app/common/scripts/streaming/othello-game.ts +++ b/src/client/app/common/scripts/streaming/othello-game.ts @@ -4,7 +4,7 @@ import MiOS from '../../mios'; export class OthelloGameStream extends Stream { constructor(os: MiOS, me, game) { super(os, 'othello-game', { - i: me ? me.account.token : null, + i: me ? me.token : null, game: game.id }); } diff --git a/src/client/app/common/scripts/streaming/othello.ts b/src/client/app/common/scripts/streaming/othello.ts index 8c6f4b9c3..f5d47431c 100644 --- a/src/client/app/common/scripts/streaming/othello.ts +++ b/src/client/app/common/scripts/streaming/othello.ts @@ -5,7 +5,7 @@ import MiOS from '../../mios'; export class OthelloStream extends Stream { constructor(os: MiOS, me) { super(os, 'othello', { - i: me.account.token + i: me.token }); } } diff --git a/src/client/app/common/views/components/signin.vue b/src/client/app/common/views/components/signin.vue index 17154e6b3..da7472b8c 100644 --- a/src/client/app/common/views/components/signin.vue +++ b/src/client/app/common/views/components/signin.vue @@ -6,7 +6,7 @@ -