Skip to content

Commit 2cedb66

Browse files
authored
agent: chat relay address type for short links (#1602)
1 parent e345671 commit 2cedb66

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

apps/smp-server/static/link.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@ <h2 class="text-xl font-bold">If you already installed SimpleX Chat for the term
512512
element.innerHTML = 'This is a one-time link of the SimpleX&nbsp;network user'
513513
} else if (url.includes('/c')) {
514514
element.innerHTML = 'This is a public channel address on SimpleX&nbsp;network'
515+
} else if (url.includes('/r')) {
516+
element.innerHTML = 'This is a chat relay address on SimpleX&nbsp;network'
515517
}
516518
}
517519
</script>

apps/smp-server/web/Static.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ generateSite si onionHost sitePath = do
103103
createLinkPage "a"
104104
createLinkPage "c"
105105
createLinkPage "g"
106+
createLinkPage "r"
106107
createLinkPage "i"
107108
logInfo $ "Generated static site contents at " <> tshow sitePath
108109
where

src/Simplex/Messaging/Agent/Protocol.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ instance ConnectionModeI c => ToField (ConnShortLink c) where toField = toField
14451445

14461446
instance (Typeable c, ConnectionModeI c) => FromField (ConnShortLink c) where fromField = blobFieldDecoder strDecode
14471447

1448-
data ContactConnType = CCTContact | CCTChannel | CCTGroup deriving (Eq, Show)
1448+
data ContactConnType = CCTContact | CCTChannel | CCTGroup | CCTRelay deriving (Eq, Show)
14491449

14501450
data AConnShortLink = forall m. ConnectionModeI m => ACSL (SConnectionMode m) (ConnShortLink m)
14511451

@@ -1593,6 +1593,7 @@ ctTypeP = \case
15931593
'A' -> pure CCTContact
15941594
'C' -> pure CCTChannel
15951595
'G' -> pure CCTGroup
1596+
'R' -> pure CCTRelay
15961597
_ -> fail "unknown contact address type"
15971598
{-# INLINE ctTypeP #-}
15981599

@@ -1601,6 +1602,7 @@ ctTypeChar = \case
16011602
CCTContact -> 'A'
16021603
CCTChannel -> 'C'
16031604
CCTGroup -> 'G'
1605+
CCTRelay -> 'R'
16041606
{-# INLINE ctTypeChar #-}
16051607

16061608
-- the servers passed to this function should be all preset servers, not servers configured by the user.

0 commit comments

Comments
 (0)