mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-02 16:58:06 +09:00
Fix #1729
This commit is contained in:
parent
ccac819eba
commit
11161004ab
@ -1,9 +1,8 @@
|
|||||||
export default (mention: {
|
import { IUser, isRemoteUser } from "../../../models/user";
|
||||||
uri: string;
|
import config from "../../../config";
|
||||||
username: string;
|
|
||||||
host: string;
|
export default (mention: IUser) => ({
|
||||||
}) => ({
|
|
||||||
type: 'Mention',
|
type: 'Mention',
|
||||||
href: mention.uri,
|
href: isRemoteUser(mention) ? mention.uri : `${config.url}/@${mention.username}`,
|
||||||
name: `@${mention.username}@${mention.host}`
|
name: isRemoteUser(mention) ? `@${mention.username}@${mention.host}` : `@${mention.username}`,
|
||||||
});
|
});
|
||||||
|
@ -54,9 +54,18 @@ export default async function renderNote(note: INote, dive = true) {
|
|||||||
? [`${attributedTo}/followers`].concat(mentions)
|
? [`${attributedTo}/followers`].concat(mentions)
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
|
const mentionUsers = await User.find({
|
||||||
|
_id: {
|
||||||
|
$in: note.mentions
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const hashtagTags = (note.tags || []).map(renderHashtag);
|
const hashtagTags = (note.tags || []).map(renderHashtag);
|
||||||
const mentionTags = (note.mentionedRemoteUsers || []).map(renderMention);
|
const mentionTags = mentionUsers.map(renderMention);
|
||||||
const tag = hashtagTags.concat(mentionTags);
|
const tag = [
|
||||||
|
...hashtagTags,
|
||||||
|
...mentionTags,
|
||||||
|
];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: `${config.url}/notes/${note._id}`,
|
id: `${config.url}/notes/${note._id}`,
|
||||||
|
Loading…
Reference in New Issue
Block a user