File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
src/Simplex/Messaging/Agent Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1428,6 +1428,35 @@ instance Eq ACreatedConnLink where
14281428
14291429deriving instance Show ACreatedConnLink
14301430
1431+ instance ConnectionModeI m => StrEncoding (CreatedConnLink m ) where
1432+ strEncode CCLink {connFullLink, connShortLink} = case connFullLink of
1433+ CRInvitationUri {} -> strEncode (CMInvitation , connFullLink, connShortLink)
1434+ CRContactUri _ -> strEncode (CMContact , connFullLink, connShortLink)
1435+ strP = (\ (ACCL _ l) -> checkConnMode l) <$?> strP
1436+ {-# INLINE strP #-}
1437+
1438+ instance ConnectionModeI m => ToField (CreatedConnLink m ) where toField = toField . Binary . strEncode
1439+
1440+ instance (Typeable m , ConnectionModeI m ) => FromField (CreatedConnLink m ) where fromField = blobFieldDecoder strDecode
1441+
1442+ instance StrEncoding ACreatedConnLink where
1443+ strEncode (ACCL _ ccl) = strEncode ccl
1444+ {-# INLINE strEncode #-}
1445+ strP =
1446+ strP >>= \ case
1447+ CMInvitation -> do
1448+ connFullLink <- strP_
1449+ connShortLink <- strP
1450+ pure $ ACCL SCMInvitation $ CCLink connFullLink connShortLink
1451+ CMContact -> do
1452+ connFullLink <- strP_
1453+ connShortLink <- strP
1454+ pure $ ACCL SCMContact $ CCLink connFullLink connShortLink
1455+
1456+ instance ToField ACreatedConnLink where toField = toField . Binary . strEncode
1457+
1458+ instance FromField ACreatedConnLink where fromField = blobFieldDecoder strDecode
1459+
14311460data AConnectionLink = forall m . ConnectionModeI m => ACL (SConnectionMode m ) (ConnectionLink m )
14321461
14331462instance Eq AConnectionLink where
You can’t perform that action at this time.
0 commit comments