diff --git a/apps/ios/SimpleXChat/ChatTypes.swift b/apps/ios/SimpleXChat/ChatTypes.swift index 7265038f38..d2e28394a2 100644 --- a/apps/ios/SimpleXChat/ChatTypes.swift +++ b/apps/ios/SimpleXChat/ChatTypes.swift @@ -5141,6 +5141,10 @@ public enum SimplexLinkType: String, Decodable, Hashable { public struct SimplexNameInfo: Decodable, Equatable, Hashable { public var nameType: SimplexNameType + public var nameDomain: SimplexNameDomain +} + +public struct SimplexNameDomain: Decodable, Equatable, Hashable { public var nameTLD: SimplexTLD public var domain: String public var subDomain: [String] diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt index aa4b677b8a..4bb7ae3d6e 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt @@ -4733,6 +4733,11 @@ enum class SimplexLinkType(val linkType: String) { @Serializable data class SimplexNameInfo( val nameType: SimplexNameType, + val nameDomain: SimplexNameDomain +) + +@Serializable +data class SimplexNameDomain( val nameTLD: SimplexTLD, val domain: String, val subDomain: List diff --git a/bots/api/TYPES.md b/bots/api/TYPES.md index af89c86411..488b7c4f05 100644 --- a/bots/api/TYPES.md +++ b/bots/api/TYPES.md @@ -165,6 +165,7 @@ This file is generated automatically. - [SecurityCode](#securitycode) - [SimplePreference](#simplepreference) - [SimplexLinkType](#simplexlinktype) +- [SimplexNameDomain](#simplexnamedomain) - [SimplexNameInfo](#simplexnameinfo) - [SimplexNameType](#simplexnametype) - [SimplexTLD](#simplextld) @@ -3447,15 +3448,23 @@ A_QUEUE: - "relay" +--- + +## SimplexNameDomain + +**Record type**: +- nameTLD: [SimplexTLD](#simplextld) +- domain: string +- subDomain: [string] + + --- ## SimplexNameInfo **Record type**: - nameType: [SimplexNameType](#simplexnametype) -- nameTLD: [SimplexTLD](#simplextld) -- domain: string -- subDomain: [string] +- nameDomain: [SimplexNameDomain](#simplexnamedomain) --- diff --git a/bots/src/API/Docs/Types.hs b/bots/src/API/Docs/Types.hs index 0f9e198cc1..c759a7453c 100644 --- a/bots/src/API/Docs/Types.hs +++ b/bots/src/API/Docs/Types.hs @@ -345,6 +345,7 @@ chatTypesDocsData = (sti @SecurityCode, STRecord, "", [], "", ""), (sti @SimplePreference, STRecord, "", [], "", ""), (sti @SimplexLinkType, STEnum, "XL", [], "", ""), + (sti @SimplexNameDomain, STRecord, "", [], "", ""), (sti @SimplexNameInfo, STRecord, "", [], "", ""), (sti @SimplexNameType, STEnum, "NT", [], "", ""), (sti @SimplexTLD, STEnum, "TLD", [], "", ""), @@ -561,6 +562,7 @@ deriving instance Generic RelayStatus deriving instance Generic ReportReason deriving instance Generic SecurityCode deriving instance Generic SimplexLinkType +deriving instance Generic SimplexNameDomain deriving instance Generic SimplexNameInfo deriving instance Generic SimplexNameType deriving instance Generic SimplexTLD diff --git a/cabal.project b/cabal.project index 728ab790c7..77e4ed838b 100644 --- a/cabal.project +++ b/cabal.project @@ -21,7 +21,7 @@ constraints: zip +disable-bzip2 +disable-zstd source-repository-package type: git location: https://github.com/simplex-chat/simplexmq.git - tag: e9265a7f7cb723d70b03e1b67af01f2666872a44 + tag: ee2ff402fed4d27d31521570c910fe82e0cf116a source-repository-package type: git diff --git a/packages/simplex-chat-client/types/typescript/src/types.ts b/packages/simplex-chat-client/types/typescript/src/types.ts index de86d1e790..6a230ecf15 100644 --- a/packages/simplex-chat-client/types/typescript/src/types.ts +++ b/packages/simplex-chat-client/types/typescript/src/types.ts @@ -3855,13 +3855,17 @@ export enum SimplexLinkType { Relay = "relay", } -export interface SimplexNameInfo { - nameType: SimplexNameType +export interface SimplexNameDomain { nameTLD: SimplexTLD domain: string subDomain: string[] } +export interface SimplexNameInfo { + nameType: SimplexNameType + nameDomain: SimplexNameDomain +} + export enum SimplexNameType { PublicGroup = "publicGroup", Contact = "contact", diff --git a/packages/simplex-chat-python/src/simplex_chat/types/_types.py b/packages/simplex-chat-python/src/simplex_chat/types/_types.py index 3bbf82d350..c3a5e0c4fb 100644 --- a/packages/simplex-chat-python/src/simplex_chat/types/_types.py +++ b/packages/simplex-chat-python/src/simplex_chat/types/_types.py @@ -2692,12 +2692,15 @@ class SimplePreference(TypedDict): SimplexLinkType = Literal["contact", "invitation", "group", "channel", "relay"] -class SimplexNameInfo(TypedDict): - nameType: "SimplexNameType" +class SimplexNameDomain(TypedDict): nameTLD: "SimplexTLD" domain: str subDomain: list[str] +class SimplexNameInfo(TypedDict): + nameType: "SimplexNameType" + nameDomain: "SimplexNameDomain" + SimplexNameType = Literal["publicGroup", "contact"] SimplexTLD = Literal["simplex", "testing", "web"] diff --git a/scripts/nix/sha256map.nix b/scripts/nix/sha256map.nix index 0832fecb09..f3bbf90b9f 100644 --- a/scripts/nix/sha256map.nix +++ b/scripts/nix/sha256map.nix @@ -1,5 +1,5 @@ { - "https://github.com/simplex-chat/simplexmq.git"."e9265a7f7cb723d70b03e1b67af01f2666872a44" = "00xyzc5advpka2d2mq11f02cmcr7fa7n6mjj53symspdpx1pgfa5"; + "https://github.com/simplex-chat/simplexmq.git"."ee2ff402fed4d27d31521570c910fe82e0cf116a" = "0vka1b2bbrjg4s8j3h6732kjqjbhji0l55pzggd89ginrdjln3fg"; "https://github.com/simplex-chat/hs-socks.git"."a30cc7a79a08d8108316094f8f2f82a0c5e1ac51" = "0yasvnr7g91k76mjkamvzab2kvlb1g5pspjyjn2fr6v83swjhj38"; "https://github.com/simplex-chat/direct-sqlcipher.git"."f814ee68b16a9447fbb467ccc8f29bdd3546bfd9" = "1ql13f4kfwkbaq7nygkxgw84213i0zm7c1a8hwvramayxl38dq5d"; "https://github.com/simplex-chat/sqlcipher-simple.git"."a46bd361a19376c5211f1058908fc0ae6bf42446" = "1z0r78d8f0812kxbgsm735qf6xx8lvaz27k1a0b4a2m0sshpd5gl"; diff --git a/tests/MarkdownTests.hs b/tests/MarkdownTests.hs index 1db400c62a..efa010ceb1 100644 --- a/tests/MarkdownTests.hs +++ b/tests/MarkdownTests.hs @@ -10,7 +10,7 @@ import Data.Text (Text) import qualified Data.Text as T import Data.Text.Encoding (encodeUtf8) import Simplex.Chat.Markdown -import Simplex.Messaging.Agent.Protocol (SimplexNameInfo (..), SimplexNameType (..), SimplexTLD (..)) +import Simplex.Messaging.Agent.Protocol (SimplexNameDomain (..), SimplexNameInfo (..), SimplexNameType (..), SimplexTLD (..)) import Simplex.Messaging.Encoding.String import Simplex.Messaging.Util ((<$$>)) import System.Console.ANSI.Types @@ -381,7 +381,7 @@ command' :: Text -> Text -> FormattedText command' = FormattedText . Just . Command sname :: SimplexNameType -> SimplexTLD -> Text -> [Text] -> Text -> Markdown -sname nt ns dom sub txt = markdown (SimplexName $ SimplexNameInfo nt ns dom sub) (pfx <> txt) +sname nt ns dom sub txt = markdown (SimplexName $ SimplexNameInfo nt (SimplexNameDomain ns dom sub)) (pfx <> txt) where pfx = case nt of NTPublicGroup -> "#"; NTContact -> "@"