File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -912,12 +912,19 @@ getConnShortLink' c nm userId = \case
912912 where
913913 decryptData :: ConnectionModeI c => SMPServer -> LinkKey -> C. SbKey -> (SMP. SenderId , QueueLinkData ) -> AM (ConnectionRequestUri c , ConnLinkData c )
914914 decryptData srv linkKey k (sndId, d) = do
915- r@ (cReq, _ ) <- liftEither $ SL. decryptLinkData @ c linkKey k d
915+ r@ (cReq, clData ) <- liftEither $ SL. decryptLinkData @ c linkKey k d
916916 let (srv', sndId') = qAddress (connReqQueue cReq)
917917 unless (srv `sameSrvHost` srv' && sndId == sndId') $
918918 throwE $ AGENT $ A_LINK " different address"
919- pure r
919+ pure $ if srv' == srv then r else (updateConnReqServer srv cReq, clData)
920920 sameSrvHost ProtocolServer {host = h :| _} ProtocolServer {host = hs} = h `elem` hs
921+ updateConnReqServer :: SMPServer -> ConnectionRequestUri c -> ConnectionRequestUri c
922+ updateConnReqServer srv = \ case
923+ CRInvitationUri crData e2eParams -> CRInvitationUri (updateQueues crData) e2eParams
924+ CRContactUri crData -> CRContactUri $ updateQueues crData
925+ where
926+ updateQueues crData@ (ConnReqUriData {crSmpQueues = SMPQueueUri vr addr :| qs}) =
927+ crData {crSmpQueues = SMPQueueUri vr addr {smpServer = srv} :| qs}
921928
922929deleteLocalInvShortLink' :: AgentClient -> ConnShortLink 'CMInvitation -> AM ()
923930deleteLocalInvShortLink' c (CSLInvitation _ srv linkId _) = withStore' c $ \ db -> deleteInvShortLink db srv linkId
You can’t perform that action at this time.
0 commit comments