summaryrefslogtreecommitdiff
path: root/src/remote/activitypub/misc
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-22 10:44:17 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-22 10:44:17 +0900
commit20e77196f28178c869402985761bd4c2fa74bf0a (patch)
treebeb333d0a01cf6752bdcc6028c82ce63f579f1f1 /src/remote/activitypub/misc
parentFix #1531 (diff)
downloadsharkey-20e77196f28178c869402985761bd4c2fa74bf0a.tar.gz
sharkey-20e77196f28178c869402985761bd4c2fa74bf0a.tar.bz2
sharkey-20e77196f28178c869402985761bd4c2fa74bf0a.zip
AP: 投票をレンダリング
Diffstat (limited to 'src/remote/activitypub/misc')
-rw-r--r--src/remote/activitypub/misc/get-note-html.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/remote/activitypub/misc/get-note-html.ts b/src/remote/activitypub/misc/get-note-html.ts
new file mode 100644
index 0000000000..a63059a38d
--- /dev/null
+++ b/src/remote/activitypub/misc/get-note-html.ts
@@ -0,0 +1,18 @@
+import { INote } from "../../../models/note";
+import toHtml from '../../../text/html';
+import parse from '../../../text/parse';
+import config from '../../../config';
+
+export default function(note: INote) {
+ if (note.text == null) return null;
+
+ let html = toHtml(parse(note.text));
+
+ if (note.poll != null) {
+ const url = `${config.url}/notes/${note._id}`;
+ // TODO: i18n
+ html += `<p>【投票】<br />${url}</p>`;
+ }
+
+ return html;
+}