This commit is contained in:
syuilo
2018-05-31 22:56:02 +09:00
parent bd758a156e
commit 51255bb446
8 changed files with 259 additions and 83 deletions

View File

@ -1,8 +1,8 @@
import config from '../../../config';
import { IRemoteUser, ILocalUser } from '../../../models/user';
import { IUser, isLocalUser } from '../../../models/user';
export default (follower: ILocalUser, followee: IRemoteUser) => ({
export default (follower: IUser, followee: IUser) => ({
type: 'Follow',
actor: `${config.url}/users/${follower._id}`,
object: followee.uri
actor: isLocalUser(follower) ? `${config.url}/users/${follower._id}` : follower.uri,
object: isLocalUser(followee) ? `${config.url}/users/${followee._id}` : followee.uri
});