mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-12-02 16:58:43 +09:00
Fix bug
This commit is contained in:
parent
ff02dc723b
commit
00290fbf75
@ -8,6 +8,8 @@ import Following from '../../models/following';
|
|||||||
import renderTombstone from '../../remote/activitypub/renderer/tombstone';
|
import renderTombstone from '../../remote/activitypub/renderer/tombstone';
|
||||||
import { updateNoteStats } from '../update-chart';
|
import { updateNoteStats } from '../update-chart';
|
||||||
import config from '../../config';
|
import config from '../../config';
|
||||||
|
import NoteUnread from '../../models/note-unread';
|
||||||
|
import read from './read';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 投稿を削除します。
|
* 投稿を削除します。
|
||||||
@ -36,6 +38,15 @@ export default async function(user: IUser, note: INote) {
|
|||||||
deletedAt: deletedAt
|
deletedAt: deletedAt
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// この投稿が関わる未読通知を削除
|
||||||
|
NoteUnread.find({
|
||||||
|
noteId: note._id
|
||||||
|
}).then(unreads => {
|
||||||
|
unreads.forEach(unread => {
|
||||||
|
read(unread.userId, unread.noteId);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
//#region ローカルの投稿なら削除アクティビティを配送
|
//#region ローカルの投稿なら削除アクティビティを配送
|
||||||
if (isLocalUser(user)) {
|
if (isLocalUser(user)) {
|
||||||
const content = pack(renderDelete(renderTombstone(`${config.url}/notes/${note._id}`), user));
|
const content = pack(renderDelete(renderTombstone(`${config.url}/notes/${note._id}`), user));
|
||||||
|
Loading…
Reference in New Issue
Block a user