summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAkihiko Odaki <nekomanma@pixiv.co.jp>2018-04-05 01:29:56 +0900
committerAkihiko Odaki <nekomanma@pixiv.co.jp>2018-04-05 01:29:56 +0900
commitf44a7389e2b67e524c953843fcb4e007349c76c2 (patch)
tree3dbb1b79ea635407deaabe1c64b2341e29c3a2d6 /src
parentImplement Mention object (diff)
downloadsharkey-f44a7389e2b67e524c953843fcb4e007349c76c2.tar.gz
sharkey-f44a7389e2b67e524c953843fcb4e007349c76c2.tar.bz2
sharkey-f44a7389e2b67e524c953843fcb4e007349c76c2.zip
Implement Hashtag object
Diffstat (limited to 'src')
-rw-r--r--src/remote/activitypub/create.ts12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/remote/activitypub/create.ts b/src/remote/activitypub/create.ts
index 710d56fd3d..31e9dba863 100644
--- a/src/remote/activitypub/create.ts
+++ b/src/remote/activitypub/create.ts
@@ -55,9 +55,16 @@ class Creator {
const { window } = new JSDOM(note.content);
const mentions = [];
+ const tags = [];
- for (const { href, type } of note.tags) {
+ for (const { href, name, type } of note.tags) {
switch (type) {
+ case 'Hashtag':
+ if (name.startsWith('#')) {
+ tags.push(name.slice(1));
+ }
+ break;
+
case 'Mention':
mentions.push(resolvePerson(resolver, href));
break;
@@ -78,7 +85,8 @@ class Creator {
appId: null,
viaMobile: false,
geo: undefined,
- uri: note.id
+ uri: note.id,
+ tags
}, null, null, await Promise.all(mentions));
const promises = [];