diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-07-21 19:33:56 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-07-21 19:33:56 +0900 |
| commit | 900a9cb34f286b0993dfea7b3278ee8cf6918cba (patch) | |
| tree | f3ac40545266578a649a961b2f31c5c9571ee4bf /src/services/note | |
| parent | #1947 (diff) | |
| download | sharkey-900a9cb34f286b0993dfea7b3278ee8cf6918cba.tar.gz sharkey-900a9cb34f286b0993dfea7b3278ee8cf6918cba.tar.bz2 sharkey-900a9cb34f286b0993dfea7b3278ee8cf6918cba.zip | |
sharedInbox対応
Diffstat (limited to 'src/services/note')
| -rw-r--r-- | src/services/note/create.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/services/note/create.ts b/src/services/note/create.ts index 7bc2dddc4f..8536b8b561 100644 --- a/src/services/note/create.ts +++ b/src/services/note/create.ts @@ -403,7 +403,9 @@ async function publishToFollowers(note: INote, noteObj: any, user: IUser, noteAc followeeId: note.userId }); - followers.map(async (following) => { + const queue: string[] = []; + + followers.map(following => { const follower = following._follower; if (isLocalUser(follower)) { @@ -423,10 +425,15 @@ async function publishToFollowers(note: INote, noteObj: any, user: IUser, noteAc } else { // フォロワーがリモートユーザーかつ投稿者がローカルユーザーなら投稿を配信 if (isLocalUser(user)) { - deliver(user, noteActivity, follower.inbox); + const inbox = follower.sharedInbox || follower.inbox; + if (!queue.includes(inbox)) queue.push(inbox); } } }); + + queue.forEach(inbox => { + deliver(user, noteActivity, inbox); + }); } function deliverNoteToMentionedRemoteUsers(mentionedUsers: IUser[], user: ILocalUser, noteActivity: any) { |