summaryrefslogtreecommitdiff
path: root/src/remote/activitypub/renderer/note.ts
diff options
context:
space:
mode:
authorrinsuki <428rinsuki+git@gmail.com>2018-06-17 16:45:01 +0900
committerrinsuki <428rinsuki+git@gmail.com>2018-06-17 16:45:01 +0900
commit20549bfdf0a5214dfb627a4ec07ef042e43f263b (patch)
tree3ac4ea0c24bbc770220eec86c5767f362329512d /src/remote/activitypub/renderer/note.ts
parentImprove user search (diff)
downloadsharkey-20549bfdf0a5214dfb627a4ec07ef042e43f263b.tar.gz
sharkey-20549bfdf0a5214dfb627a4ec07ef042e43f263b.tar.bz2
sharkey-20549bfdf0a5214dfb627a4ec07ef042e43f263b.zip
Fix #1729
Diffstat (limited to 'src/remote/activitypub/renderer/note.ts')
-rw-r--r--src/remote/activitypub/renderer/note.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/remote/activitypub/renderer/note.ts b/src/remote/activitypub/renderer/note.ts
index aba0dc809a..f9e559d307 100644
--- a/src/remote/activitypub/renderer/note.ts
+++ b/src/remote/activitypub/renderer/note.ts
@@ -54,9 +54,18 @@ export default async function renderNote(note: INote, dive = true) {
? [`${attributedTo}/followers`].concat(mentions)
: [];
+ const mentionUsers = await User.find({
+ _id: {
+ $in: note.mentions
+ }
+ });
+
const hashtagTags = (note.tags || []).map(renderHashtag);
- const mentionTags = (note.mentionedRemoteUsers || []).map(renderMention);
- const tag = hashtagTags.concat(mentionTags);
+ const mentionTags = mentionUsers.map(renderMention);
+ const tag = [
+ ...hashtagTags,
+ ...mentionTags,
+ ];
return {
id: `${config.url}/notes/${note._id}`,