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