[backend] Don't emit followRequestAccepted if followee is not locked

Resolves #395
This commit is contained in:
Laura Hausmann 2023-11-23 22:17:12 +01:00
parent e5276e2765
commit 8ed1bda017
Signed by: zotan
GPG key ID: D044E84C5BE01605
2 changed files with 8 additions and 4 deletions

View file

@ -38,6 +38,7 @@ export async function insertFollowingDoc(
uri: User["host"];
inbox: User["inbox"];
sharedInbox: User["sharedInbox"];
isLocked: User["isLocked"];
},
follower: {
id: User["id"];
@ -92,10 +93,12 @@ export async function insertFollowingDoc(
followerId: follower.id,
});
// Create notification that request was accepted.
createNotification(follower.id, "followRequestAccepted", {
notifierId: followee.id,
});
if (followee.isLocked) {
// Create notification that request was accepted.
createNotification(follower.id, "followRequestAccepted", {
notifierId: followee.id,
});
}
}
if (alreadyFollowed) return;

View file

@ -16,6 +16,7 @@ export default async function (
uri: User["host"];
inbox: User["inbox"];
sharedInbox: User["sharedInbox"];
isLocked: User["isLocked"];
},
follower: CacheableUser,
) {