summaryrefslogtreecommitdiff
path: root/src/Erebos
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2026-01-13 21:15:36 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2026-01-13 21:57:07 +0100
commit70e22576dc6fbd1a8156d4c66f39a260f83479bf (patch)
tree29a9b5a5e0d11fff5699f409c13d8c566fdeec88 /src/Erebos
parent9e7a29e0f22afbfe5bdc0544735ad31d78758c7c (diff)
Call “accepted” hook only for valid invites
Diffstat (limited to 'src/Erebos')
-rw-r--r--src/Erebos/Invite.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Erebos/Invite.hs b/src/Erebos/Invite.hs
index faeb646..89670ec 100644
--- a/src/Erebos/Invite.hs
+++ b/src/Erebos/Invite.hs
@@ -188,13 +188,13 @@ instance Service InviteService where
serviceHandler = fromStored >>> \case
AcceptInvite token -> do
- asks (inviteHookAccepted . svcAttributes) >>= ($ token)
invites <- fromSetBy (comparing inviteToken) . lookupSharedValue . lsShared . fromStored <$> getLocalHead
case find ((Just token ==) . inviteToken) invites of
Just invite
| Just name <- inviteContact invite
, [] <- inviteAccepted invite
-> do
+ asks (inviteHookAccepted . svcAttributes) >>= ($ token)
identity <- asks svcPeerIdentity
cdata <- mstore ContactData
{ cdPrev = []