Implement #2983
This commit is contained in:
parent
8ba87443ca
commit
19af2d7a7b
4 changed files with 77 additions and 1 deletions
|
|
@ -8,7 +8,7 @@ import renderNote from '../../remote/activitypub/renderer/note';
|
|||
import renderCreate from '../../remote/activitypub/renderer/create';
|
||||
import renderAnnounce from '../../remote/activitypub/renderer/announce';
|
||||
import packAp from '../../remote/activitypub/renderer';
|
||||
import { IDriveFile } from '../../models/drive-file';
|
||||
import DriveFile, { IDriveFile } from '../../models/drive-file';
|
||||
import notify from '../../notify';
|
||||
import NoteWatching from '../../models/note-watching';
|
||||
import watch from './watch';
|
||||
|
|
@ -173,6 +173,17 @@ export default async (user: IUser, data: Option, silent = false) => new Promise<
|
|||
// ハッシュタグ登録
|
||||
tags.map(tag => registerHashtag(user, tag));
|
||||
|
||||
// ファイルが添付されていた場合ドライブのファイルの「このファイルが添付された投稿一覧」プロパティにこの投稿を追加
|
||||
if (data.files) {
|
||||
data.files.forEach(file => {
|
||||
DriveFile.update({ _id: file._id }, {
|
||||
$push: {
|
||||
'metadata.attachedNoteIds': note._id
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Increment notes count
|
||||
incNotesCount(user);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue