From 442eb914a350a66716580fb9ed306fec1f27756d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Tue, 13 Jan 2026 21:38:03 +0100 Subject: =?UTF-8?q?Pass=20whole=20Invite=20to=20the=20=E2=80=9Caccepted?= =?UTF-8?q?=E2=80=9D=20hook?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Erebos/Invite.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Erebos') 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 = [] -- cgit v1.2.3