diff options
Diffstat (limited to 'src/remote/activitypub/kernel/undo')
| -rw-r--r-- | src/remote/activitypub/kernel/undo/follow.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/remote/activitypub/kernel/undo/follow.ts b/src/remote/activitypub/kernel/undo/follow.ts index a85cb0305d..c0b10c1898 100644 --- a/src/remote/activitypub/kernel/undo/follow.ts +++ b/src/remote/activitypub/kernel/undo/follow.ts @@ -1,3 +1,4 @@ +import * as mongo from 'mongodb'; import User, { IRemoteUser } from '../../../../models/user'; import config from '../../../../config'; import unfollow from '../../../../services/following/delete'; @@ -10,7 +11,9 @@ export default async (actor: IRemoteUser, activity: IFollow): Promise<void> => { return null; } - const followee = await User.findOne({ _id: id.split('/').pop() }); + const followee = await User.findOne({ + _id: new mongo.ObjectID(id.split('/').pop()) + }); if (followee === null) { throw new Error('followee not found'); |