From f676feff9f002f5896bbb118bbc7ddba6fe51850 Mon Sep 17 00:00:00 2001 From: mei23 Date: Mon, 21 Jan 2019 05:22:32 +0900 Subject: [PATCH] Provides choices as text for AP --- src/remote/activitypub/renderer/note.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/remote/activitypub/renderer/note.ts b/src/remote/activitypub/renderer/note.ts index 75c8535973..812ad5c763 100644 --- a/src/remote/activitypub/renderer/note.ts +++ b/src/remote/activitypub/renderer/note.ts @@ -105,9 +105,16 @@ export default async function renderNote(note: INote, dive = true): Promise } let apText = text; + if (apText == null) apText = ''; + + // Provides choices as text for AP + if (note.poll != null) { + const cs = note.poll.choices.map(c => `${c.id}: ${c.text}`); + apText += '\n'; + apText += cs.join('\n'); + } if (quote) { - if (apText == null) apText = ''; apText += `\n\nRE: ${quote}`; }