1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-18 08:38:52 +09:00
misskey/src/remote/activitypub/renderer/mention.ts

9 lines
338 B
TypeScript
Raw Normal View History

2018-06-18 14:28:43 +09:00
import { IUser, isRemoteUser } from '../../../models/user';
import config from '../../../config';
2018-06-17 16:45:01 +09:00
export default (mention: IUser) => ({
2018-06-13 05:11:55 +09:00
type: 'Mention',
2018-06-17 16:45:01 +09:00
href: isRemoteUser(mention) ? mention.uri : `${config.url}/@${mention.username}`,
name: isRemoteUser(mention) ? `@${mention.username}@${mention.host}` : `@${mention.username}`,
2018-06-13 05:11:55 +09:00
});