1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-18 00:29:10 +09:00
misskey/src/remote/activitypub/renderer/mention.ts
2018-06-18 14:28:43 +09:00

9 lines
338 B
TypeScript

import { IUser, isRemoteUser } from '../../../models/user';
import config from '../../../config';
export default (mention: IUser) => ({
type: 'Mention',
href: isRemoteUser(mention) ? mention.uri : `${config.url}/@${mention.username}`,
name: isRemoteUser(mention) ? `@${mention.username}@${mention.host}` : `@${mention.username}`,
});