- const subscription = await ActorFollowModel.loadByActorAndTargetNameAndHostForAPI(user.Account.Actor.id, name, host)
-
- if (!subscription || !subscription.ActorFollowing.VideoChannel) {
- return res
- .status(404)
- .json({
- error: `Subscription ${req.params.uri} not found.`
- })
- .end()
+ const subscription = await ActorFollowModel.loadByActorAndTargetNameAndHostForAPI({
+ actorId: user.Account.Actor.id,
+ targetName: name,
+ targetHost: host,
+ state: 'accepted'
+ })
+
+ if (!subscription?.ActorFollowing.VideoChannel) {
+ return res.fail({
+ status: HttpStatusCode.NOT_FOUND_404,
+ message: `Subscription ${req.params.uri} not found.`
+ })