diff --git a/src/Simplex/Messaging/Agent/Protocol.hs b/src/Simplex/Messaging/Agent/Protocol.hs index 2b220f948..64ad8aae1 100644 --- a/src/Simplex/Messaging/Agent/Protocol.hs +++ b/src/Simplex/Messaging/Agent/Protocol.hs @@ -129,6 +129,7 @@ module Simplex.Messaging.Agent.Protocol ClientServiceId, sameConnReqContact, sameShortLinkContact, + sameConnLinkContact, simplexChat, connReqUriP', simplexConnReqUri, @@ -1666,6 +1667,11 @@ sameShortLinkContact :: ConnShortLink 'CMContact -> ConnShortLink 'CMContact -> sameShortLinkContact (CSLContact _ ct srv k) (CSLContact _ ct' srv' k') = ct == ct' && sameSrvAddr srv srv' && k == k' +sameConnLinkContact :: ConnectionLink 'CMContact -> ConnectionLink 'CMContact -> Bool +sameConnLinkContact (CLFull cr) (CLFull cr') = sameConnReqContact cr cr' +sameConnLinkContact (CLShort sl) (CLShort sl') = sameShortLinkContact sl sl' +sameConnLinkContact _ _ = False + checkConnMode :: forall t m m'. (ConnectionModeI m, ConnectionModeI m') => t m' -> Either String (t m) checkConnMode c = case testEquality (sConnectionMode @m) (sConnectionMode @m') of Just Refl -> Right c