Skip to content
Draft
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions apps/common/Web/static/.well-known/apple-app-site-association
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@
},
{
"/": "/i"
},
{
"/": "/p/*"
},
{
"/": "/p"
},
{
"/": "/s/*"
},
{
"/": "/s"
}
]
}
Expand Down
4 changes: 4 additions & 0 deletions apps/common/Web/static/link.html
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,10 @@ <h2 class="text-xl font-bold">If you already installed SimpleX Chat for the term
element.innerHTML = 'This is a public channel address on SimpleX&nbsp;network'
} else if (url.includes('/r')) {
element.innerHTML = 'This is a chat relay address on SimpleX&nbsp;network'
} else if (url.includes('/p')) {
element.innerHTML = 'This is a public group address on SimpleX&nbsp;network'
} else if (url.includes('/s')) {
element.innerHTML = 'This is a site address on SimpleX&nbsp;network'
}
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion apps/smp-server/SMPWeb.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ smpGenerateSite si onionHost path =
Web.generateSite embeddedContent (serverInformation si onionHost) smpLinkPages path

smpLinkPages :: [String]
smpLinkPages = ["contact", "invitation", "a", "c", "g", "r", "i"]
smpLinkPages = ["contact", "invitation", "a", "c", "g", "r", "i", "p", "s"]

serverInformation :: ServerInformation -> Maybe TransportHost -> ByteString
serverInformation ServerInformation {config, information} onionHost = render (Web.indexHtml embeddedContent) substs
Expand Down
6 changes: 5 additions & 1 deletion src/Simplex/Messaging/Agent/Protocol.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,7 @@ instance ConnectionModeI c => ToField (ConnShortLink c) where toField = toField

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

data ContactConnType = CCTContact | CCTChannel | CCTGroup | CCTRelay deriving (Eq, Show)
data ContactConnType = CCTContact | CCTChannel | CCTGroup | CCTRelay | CCTPublicGroup | CCTSite deriving (Eq, Show)

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

Expand Down Expand Up @@ -1814,6 +1814,8 @@ ctTypeP = \case
'C' -> pure CCTChannel
'G' -> pure CCTGroup
'R' -> pure CCTRelay
'P' -> pure CCTPublicGroup
'S' -> pure CCTSite
_ -> fail "unknown contact address type"
{-# INLINE ctTypeP #-}

Expand All @@ -1823,6 +1825,8 @@ ctTypeChar = \case
CCTChannel -> 'C'
CCTGroup -> 'G'
CCTRelay -> 'R'
CCTPublicGroup -> 'P'
CCTSite -> 'S'
{-# INLINE ctTypeChar #-}

instance StrEncoding ContactConnType where
Expand Down
4 changes: 4 additions & 0 deletions tests/AgentTests/ConnectionRequestTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,15 @@ connectionRequestTests =
CSLContact SLSServer CCTContact srv (LinkKey "0123456789abcdef0123456789abcdef") #==# "https://smp.simplex.im/a#MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY?h=jjbyvoemxysm7qxap7m5d5m35jzv5qq6gnlv7s4rsn7tdwwmuqciwpid.onion&p=5223&c=1234-w"
CSLContact SLSServer CCTGroup srv (LinkKey "0123456789abcdef0123456789abcdef") #==# "https://smp.simplex.im/g#MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY?h=jjbyvoemxysm7qxap7m5d5m35jzv5qq6gnlv7s4rsn7tdwwmuqciwpid.onion&p=5223&c=1234-w"
CSLContact SLSServer CCTContact shortSrv (LinkKey "0123456789abcdef0123456789abcdef") #==# "https://smp.simplex.im/a#MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY"
CSLContact SLSServer CCTPublicGroup shortSrv (LinkKey "0123456789abcdef0123456789abcdef") #==# "https://smp.simplex.im/p#MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY"
CSLContact SLSServer CCTSite shortSrv (LinkKey "0123456789abcdef0123456789abcdef") #==# "https://smp.simplex.im/s#MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY"
CSLInvitation SLSServer srv (EntityId "0123456789abcdef01234567") (LinkKey "0123456789abcdef0123456789abcdef") #==# "https://smp.simplex.im/i#MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3/MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY?h=jjbyvoemxysm7qxap7m5d5m35jzv5qq6gnlv7s4rsn7tdwwmuqciwpid.onion&p=5223&c=1234-w"
CSLInvitation SLSServer shortSrv (EntityId "0123456789abcdef01234567") (LinkKey "0123456789abcdef0123456789abcdef") #==# "https://smp.simplex.im/i#MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3/MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY"
CSLContact SLSSimplex CCTContact srv (LinkKey "0123456789abcdef0123456789abcdef") #==# "simplex:/a#MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY?h=smp.simplex.im%2Cjjbyvoemxysm7qxap7m5d5m35jzv5qq6gnlv7s4rsn7tdwwmuqciwpid.onion&p=5223&c=1234-w"
CSLContact SLSSimplex CCTGroup srv (LinkKey "0123456789abcdef0123456789abcdef") #==# "simplex:/g#MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY?h=smp.simplex.im%2Cjjbyvoemxysm7qxap7m5d5m35jzv5qq6gnlv7s4rsn7tdwwmuqciwpid.onion&p=5223&c=1234-w"
CSLContact SLSSimplex CCTContact shortSrv (LinkKey "0123456789abcdef0123456789abcdef") #==# "simplex:/a#MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY?h=smp.simplex.im"
CSLContact SLSSimplex CCTPublicGroup shortSrv (LinkKey "0123456789abcdef0123456789abcdef") #==# "simplex:/p#MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY?h=smp.simplex.im"
CSLContact SLSSimplex CCTSite shortSrv (LinkKey "0123456789abcdef0123456789abcdef") #==# "simplex:/s#MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY?h=smp.simplex.im"
CSLInvitation SLSSimplex srv (EntityId "0123456789abcdef01234567") (LinkKey "0123456789abcdef0123456789abcdef") #==# "simplex:/i#MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3/MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY?h=smp.simplex.im%2Cjjbyvoemxysm7qxap7m5d5m35jzv5qq6gnlv7s4rsn7tdwwmuqciwpid.onion&p=5223&c=1234-w"
CSLInvitation SLSSimplex shortSrv (EntityId "0123456789abcdef01234567") (LinkKey "0123456789abcdef0123456789abcdef") #==# "simplex:/i#MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3/MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY?h=smp.simplex.im"
it "should parse simplex: links without the slash after the scheme" $ do
Expand Down
Loading