mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-27 20:37:32 -07:00
Merge pull request #1399 from akihikodaki/duplicate
Implement Hashtag object
This commit is contained in:
commit
ff4f74e989
1 changed files with 10 additions and 2 deletions
|
@ -55,9 +55,16 @@ class Creator {
|
||||||
|
|
||||||
const { window } = new JSDOM(note.content);
|
const { window } = new JSDOM(note.content);
|
||||||
const mentions = [];
|
const mentions = [];
|
||||||
|
const tags = [];
|
||||||
|
|
||||||
for (const { href, type } of note.tags) {
|
for (const { href, name, type } of note.tags) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case 'Hashtag':
|
||||||
|
if (name.startsWith('#')) {
|
||||||
|
tags.push(name.slice(1));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case 'Mention':
|
case 'Mention':
|
||||||
mentions.push(resolvePerson(resolver, href));
|
mentions.push(resolvePerson(resolver, href));
|
||||||
break;
|
break;
|
||||||
|
@ -78,7 +85,8 @@ class Creator {
|
||||||
appId: null,
|
appId: null,
|
||||||
viaMobile: false,
|
viaMobile: false,
|
||||||
geo: undefined,
|
geo: undefined,
|
||||||
uri: note.id
|
uri: note.id,
|
||||||
|
tags
|
||||||
}, null, null, await Promise.all(mentions));
|
}, null, null, await Promise.all(mentions));
|
||||||
|
|
||||||
const promises = [];
|
const promises = [];
|
||||||
|
|
Loading…
Reference in a new issue