From a01251477ee5ab4766810453dd540170e65c02b2 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 6 Apr 2018 20:45:33 +0900 Subject: [PATCH] Revert "Remove silent flag" This reverts commit 9c15c94f801de7019f014446aa3b8ea42980a1da. --- src/remote/activitypub/act/create/note.ts | 2 +- src/services/post/create.ts | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/remote/activitypub/act/create/note.ts b/src/remote/activitypub/act/create/note.ts index 2ccd503ae..d50042e16 100644 --- a/src/remote/activitypub/act/create/note.ts +++ b/src/remote/activitypub/act/create/note.ts @@ -10,7 +10,7 @@ import createImage from './image'; const log = debug('misskey:activitypub'); -export default async function createNote(resolver: Resolver, actor: IRemoteUser, note): Promise { +export default async function createNote(resolver: Resolver, actor: IRemoteUser, note, silent = false): Promise { if ( ('attributedTo' in note && actor.account.uri !== note.attributedTo) || typeof note.id !== 'string' diff --git a/src/services/post/create.ts b/src/services/post/create.ts index 0bede2772..745683b51 100644 --- a/src/services/post/create.ts +++ b/src/services/post/create.ts @@ -31,7 +31,7 @@ export default async (user: IUser, data: { visibility?: string; uri?: string; app?: IApp; -}) => new Promise(async (res, rej) => { +}, silent = false) => new Promise(async (res, rej) => { if (data.createdAt == null) data.createdAt = new Date(); if (data.visibility == null) data.visibility = 'public'; @@ -127,10 +127,7 @@ export default async (user: IUser, data: { _id: false }); - // この投稿が3分以内に作成されたものであるならストリームに配信 - const shouldDistribute = new Date().getTime() - post.createdAt.getTime() < 1000 * 60 * 3; - - if (shouldDistribute) { + if (!silent) { const note = await renderNote(user, post); const content = renderCreate(note); content['@context'] = context;