Talk federation (#5534)
This commit is contained in:
@@ -12,7 +12,7 @@ import { Emoji } from '../../../models/entities/emoji';
|
||||
import { Poll } from '../../../models/entities/poll';
|
||||
import { ensure } from '../../../prelude/ensure';
|
||||
|
||||
export default async function renderNote(note: Note, dive = true): Promise<any> {
|
||||
export default async function renderNote(note: Note, dive = true, isTalk = false): Promise<any> {
|
||||
const promisedFiles: Promise<DriveFile[]> = note.fileIds.length > 0
|
||||
? DriveFiles.find({ id: In(note.fileIds) })
|
||||
: Promise.resolve([]);
|
||||
@@ -145,6 +145,10 @@ export default async function renderNote(note: Note, dive = true): Promise<any>
|
||||
}))
|
||||
} : {};
|
||||
|
||||
const asTalk = isTalk ? {
|
||||
_misskey_talk: true
|
||||
} : {};
|
||||
|
||||
return {
|
||||
id: `${config.url}/notes/${note.id}`,
|
||||
type: 'Note',
|
||||
@@ -160,7 +164,8 @@ export default async function renderNote(note: Note, dive = true): Promise<any>
|
||||
attachment: files.map(renderDocument),
|
||||
sensitive: note.cw != null || files.some(file => file.isSensitive),
|
||||
tag,
|
||||
...asPoll
|
||||
...asPoll,
|
||||
...asTalk
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user