diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2019-05-20 13:34:51 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-05-20 13:34:51 +0900 |
| commit | 5a3ea38bbfef209bc11d7fc5eb125d9ed2611c1c (patch) | |
| tree | efdc40e61bdaaa1f485443351e449e483a4dd6bd /src | |
| parent | 11.17.1 (diff) | |
| download | sharkey-5a3ea38bbfef209bc11d7fc5eb125d9ed2611c1c.tar.gz sharkey-5a3ea38bbfef209bc11d7fc5eb125d9ed2611c1c.tar.bz2 sharkey-5a3ea38bbfef209bc11d7fc5eb125d9ed2611c1c.zip | |
Fix: Delete is not deliver (#4950)
* Fix: Delete is not deliver
* fix
Diffstat (limited to 'src')
| -rw-r--r-- | src/services/note/delete.ts | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/services/note/delete.ts b/src/services/note/delete.ts index c03c742ee1..95776f7287 100644 --- a/src/services/note/delete.ts +++ b/src/services/note/delete.ts @@ -8,7 +8,6 @@ import { registerOrFetchInstanceDoc } from '../register-or-fetch-instance-doc'; import { User } from '../../models/entities/user'; import { Note } from '../../models/entities/note'; import { Notes, Users, Followings, Instances } from '../../models'; -import { Not } from 'typeorm'; import { notesChart, perUserNotesChart, instanceChart } from '../chart'; /** @@ -38,13 +37,21 @@ export default async function(user: User, note: Note, quiet = false) { if (Users.isLocalUser(user)) { const content = renderActivity(renderDelete(renderTombstone(`${config.url}/notes/${note.id}`), user)); - const followings = await Followings.find({ - followeeId: user.id, - followerHost: Not(null) + const queue: string[] = []; + + const followers = await Followings.find({ + followeeId: note.userId }); - for (const following of followings) { - deliver(user, content, following.followerInbox); + for (const following of followers) { + if (Followings.isRemoteFollower(following)) { + const inbox = following.followerSharedInbox || following.followerInbox; + if (!queue.includes(inbox)) queue.push(inbox); + } + } + + for (const inbox of queue) { + deliver(user as any, content, inbox); } } //#endregion |