Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Simplex/Messaging/Agent/Protocol.hs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ module Simplex.Messaging.Agent.Protocol
ClientServiceId,
sameConnReqContact,
sameShortLinkContact,
sameConnLinkContact,
simplexChat,
connReqUriP',
simplexConnReqUri,
Expand Down Expand Up @@ -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
Expand Down
Loading