From 93925b257c76ee95d9b9ea3dcf433fecdb514c9c Mon Sep 17 00:00:00 2001 From: Evgeny Date: Wed, 1 Jul 2026 17:37:45 +0100 Subject: [PATCH] types: instance for contact connection type (#1822) Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com> --- src/Simplex/Messaging/Agent/Protocol.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Simplex/Messaging/Agent/Protocol.hs b/src/Simplex/Messaging/Agent/Protocol.hs index b61c2d6b6..87afce2eb 100644 --- a/src/Simplex/Messaging/Agent/Protocol.hs +++ b/src/Simplex/Messaging/Agent/Protocol.hs @@ -1691,6 +1691,10 @@ ctTypeChar = \case CCTRelay -> 'R' {-# INLINE ctTypeChar #-} +instance StrEncoding ContactConnType where + strEncode = B.singleton . ctTypeChar + strP = A.anyChar >>= ctTypeP + -- the servers passed to this function should be all preset servers, not servers configured by the user. shortenShortLink :: NonEmpty SMPServer -> ConnShortLink m -> ConnShortLink m shortenShortLink presetSrvs = \case