diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-04-05 01:32:03 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-05 01:32:03 +0900 |
| commit | 18728cb394fb8c52e923fac46174f86e2bfb8960 (patch) | |
| tree | 9e0b73fc84086764e21c649a17f79f534724bd17 /src | |
| parent | Merge pull request #1398 from akihikodaki/duplicate (diff) | |
| parent | Implement Hashtag object (diff) | |
| download | sharkey-18728cb394fb8c52e923fac46174f86e2bfb8960.tar.gz sharkey-18728cb394fb8c52e923fac46174f86e2bfb8960.tar.bz2 sharkey-18728cb394fb8c52e923fac46174f86e2bfb8960.zip | |
Merge pull request #1399 from akihikodaki/duplicate
Implement Hashtag object
Diffstat (limited to 'src')
| -rw-r--r-- | src/remote/activitypub/create.ts | 12 |
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 = []; |