From 900a9cb34f286b0993dfea7b3278ee8cf6918cba Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 21 Jul 2018 19:33:56 +0900 Subject: sharedInbox対応 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/note/create.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/services/note') 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) { -- cgit v1.2.3-freya