From 2c74659ec4a9f03bfc812cc26dadfd69f3b3a40e Mon Sep 17 00:00:00 2001 From: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Date: Thu, 16 Oct 2025 19:03:29 +0400 Subject: [PATCH] agent: sameConnLinkContact function --- src/Simplex/Messaging/Agent/Protocol.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Simplex/Messaging/Agent/Protocol.hs b/src/Simplex/Messaging/Agent/Protocol.hs index a2b7df4c9..414e7755a 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, @@ -1664,6 +1665,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