Talk federation (#5534)

This commit is contained in:
MeiMei
2019-10-29 06:01:14 +09:00
committed by syuilo
parent 1e58b3daff
commit 245b08b624
6 changed files with 125 additions and 74 deletions

View File

@@ -23,6 +23,7 @@ import { genId } from '../../../misc/gen-id';
import { fetchMeta } from '../../../misc/fetch-meta';
import { ensure } from '../../../prelude/ensure';
import { getApLock } from '../../../misc/app-lock';
import { createMessage } from '../../../services/messages/create';
const logger = apLogger;
@@ -223,6 +224,13 @@ export async function createNote(value: string | IObject, resolver?: Resolver, s
if (actor.uri) updatePerson(actor.uri);
}
if (note._misskey_talk && visibility === 'specified') {
for (const recipient of visibleUsers) {
await createMessage(actor, recipient, undefined, text || undefined, (files && files.length > 0) ? files[0] : null);
return null;
}
}
return await post(actor, {
createdAt: note.published ? new Date(note.published) : null,
files,