diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-01-13 21:38:03 +0100 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-01-13 21:57:07 +0100 |
| commit | 442eb914a350a66716580fb9ed306fec1f27756d (patch) | |
| tree | 79c17ca1d248014c64971f987a5954c82cef037f /src/Erebos/Invite.hs | |
| parent | 70e22576dc6fbd1a8156d4c66f39a260f83479bf (diff) | |
Pass whole Invite to the “accepted” hook
Diffstat (limited to 'src/Erebos/Invite.hs')
| -rw-r--r-- | src/Erebos/Invite.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Erebos/Invite.hs b/src/Erebos/Invite.hs index 89670ec..d815625 100644 --- a/src/Erebos/Invite.hs +++ b/src/Erebos/Invite.hs @@ -136,17 +136,17 @@ data InviteService | UnknownInvitePacket data InviteServiceAttributes = InviteServiceAttributes - { inviteHookAccepted :: InviteToken -> ServiceHandler InviteService () + { inviteHookAccepted :: Invite -> ServiceHandler InviteService () , inviteHookReplyContact :: InviteToken -> Maybe Text -> ServiceHandler InviteService () , inviteHookReplyInvalid :: InviteToken -> ServiceHandler InviteService () } defaultInviteServiceAttributes :: InviteServiceAttributes defaultInviteServiceAttributes = InviteServiceAttributes - { inviteHookAccepted = \token -> do + { inviteHookAccepted = \Invite {..} -> do pid <- asks $ svcPeerIdentity - svcPrint $ T.unpack $ "Invite accepted by " <> displayIdentity pid - <> " (token: " <> textInviteToken token <> ")" + svcPrint $ T.unpack $ "Invite" <> maybe "" ((" for “" <>) . (<> "”")) inviteContact <> " accepted by " <> displayIdentity pid + <> " (token: " <> maybe "??" textInviteToken inviteToken <> ")" , inviteHookReplyContact = \token mbName -> do pid <- asks $ svcPeerIdentity svcPrint $ T.unpack $ "Invite confirmed by " <> displayIdentity pid @@ -194,7 +194,7 @@ instance Service InviteService where | Just name <- inviteContact invite , [] <- inviteAccepted invite -> do - asks (inviteHookAccepted . svcAttributes) >>= ($ token) + asks (inviteHookAccepted . svcAttributes) >>= ($ invite) identity <- asks svcPeerIdentity cdata <- mstore ContactData { cdPrev = [] |