mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 04:33:50 +01:00
commit
3aac984850
@ -1,9 +1,8 @@
|
||||
export default (mention: {
|
||||
uri: string;
|
||||
username: string;
|
||||
host: string;
|
||||
}) => ({
|
||||
import { IUser, isRemoteUser } from "../../../models/user";
|
||||
import config from "../../../config";
|
||||
|
||||
export default (mention: IUser) => ({
|
||||
type: 'Mention',
|
||||
href: mention.uri,
|
||||
name: `@${mention.username}@${mention.host}`
|
||||
href: isRemoteUser(mention) ? mention.uri : `${config.url}/@${mention.username}`,
|
||||
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)
|
||||
: [];
|
||||
|
||||
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}`,
|
||||
|
Loading…
Reference in New Issue
Block a user