mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-07-10 01:21:52 +00:00
core, ui: resolve untyped domains (#7198)
* core: resolve untyped domains * CPError * only add domain when it has link of correct type * resolve first * handle errors * remove CPError * update UI types * remove unused name Co-authored-by: Evgeny <evgeny@poberezkin.com> * refactor connection plan * kotlin: show domain and alternative chat, haskell tests for dual domains * view/tests * update kotlin * dual domains accounting for business chats * refactor, fix * fix kotlin * remove comment * search * add resolve mode * local resolution * refactor, bot types * search both contact and channel by name * fix * fix searching business chats by name * fix ui * ios * fix ios * fix icon --------- Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
This commit is contained in:
@@ -439,7 +439,7 @@ APIAddContact_Response = CR.Invitation | CR.ChatCmdError
|
||||
class APIConnectPlan(TypedDict):
|
||||
userId: int # int64
|
||||
connectTarget: NotRequired[str]
|
||||
resolveKnown: bool
|
||||
resolveMode: "T.PlanResolveMode"
|
||||
linkOwnerSig: NotRequired["T.LinkOwnerSig"]
|
||||
|
||||
|
||||
|
||||
@@ -57,6 +57,8 @@ class ConnectionPlan(TypedDict):
|
||||
type: Literal["connectionPlan"]
|
||||
user: "T.User"
|
||||
connLink: "T.CreatedConnLink"
|
||||
planSimplexName: NotRequired["T.SimplexNameInfo"]
|
||||
otherSimplexName: NotRequired["T.SimplexNameInfo"]
|
||||
connectionPlan: "T.ConnectionPlan"
|
||||
|
||||
class ContactAlreadyExists(TypedDict):
|
||||
|
||||
@@ -793,6 +793,9 @@ class ChatErrorType_simplexDomainNotReady(TypedDict):
|
||||
simplexDomain: "SimplexDomain"
|
||||
simplexDomainError: "SimplexDomainError"
|
||||
|
||||
class ChatErrorType_notResolvedLocally(TypedDict):
|
||||
type: Literal["notResolvedLocally"]
|
||||
|
||||
class ChatErrorType_unsupportedConnReq(TypedDict):
|
||||
type: Literal["unsupportedConnReq"]
|
||||
|
||||
@@ -1024,6 +1027,7 @@ ChatErrorType = (
|
||||
| ChatErrorType_chatStoreChanged
|
||||
| ChatErrorType_invalidConnReq
|
||||
| ChatErrorType_simplexDomainNotReady
|
||||
| ChatErrorType_notResolvedLocally
|
||||
| ChatErrorType_unsupportedConnReq
|
||||
| ChatErrorType_connReqMessageProhibited
|
||||
| ChatErrorType_contactNotReady
|
||||
@@ -1080,7 +1084,7 @@ ChatErrorType = (
|
||||
| ChatErrorType_exception
|
||||
)
|
||||
|
||||
ChatErrorType_Tag = Literal["noActiveUser", "noConnectionUser", "noSndFileUser", "noRcvFileUser", "userUnknown", "userExists", "chatRelayExists", "differentActiveUser", "cantDeleteActiveUser", "cantDeleteLastUser", "cantHideLastUser", "hiddenUserAlwaysMuted", "emptyUserPassword", "userAlreadyHidden", "userNotHidden", "invalidDisplayName", "chatNotStarted", "chatNotStopped", "chatStoreChanged", "invalidConnReq", "simplexDomainNotReady", "unsupportedConnReq", "connReqMessageProhibited", "contactNotReady", "contactNotActive", "contactDisabled", "connectionDisabled", "groupUserRole", "groupMemberInitialRole", "contactIncognitoCantInvite", "groupIncognitoCantInvite", "groupContactRole", "groupDuplicateMember", "groupDuplicateMemberId", "groupNotJoined", "groupMemberNotActive", "cantBlockMemberForSelf", "groupMemberUserRemoved", "groupMemberNotFound", "groupCantResendInvitation", "groupInternal", "fileNotFound", "fileSize", "fileAlreadyReceiving", "fileCancelled", "fileCancel", "fileAlreadyExists", "fileWrite", "fileSend", "fileRcvChunk", "fileInternal", "fileImageType", "fileImageSize", "fileNotReceived", "fileNotApproved", "fallbackToSMPProhibited", "inlineFileProhibited", "invalidForward", "invalidChatItemUpdate", "invalidChatItemDelete", "hasCurrentCall", "noCurrentCall", "callContact", "directMessagesProhibited", "agentVersion", "agentNoSubResult", "commandError", "agentCommandError", "invalidFileDescription", "connectionIncognitoChangeProhibited", "connectionUserChangeProhibited", "peerChatVRangeIncompatible", "relayTestError", "internalError", "exception"]
|
||||
ChatErrorType_Tag = Literal["noActiveUser", "noConnectionUser", "noSndFileUser", "noRcvFileUser", "userUnknown", "userExists", "chatRelayExists", "differentActiveUser", "cantDeleteActiveUser", "cantDeleteLastUser", "cantHideLastUser", "hiddenUserAlwaysMuted", "emptyUserPassword", "userAlreadyHidden", "userNotHidden", "invalidDisplayName", "chatNotStarted", "chatNotStopped", "chatStoreChanged", "invalidConnReq", "simplexDomainNotReady", "notResolvedLocally", "unsupportedConnReq", "connReqMessageProhibited", "contactNotReady", "contactNotActive", "contactDisabled", "connectionDisabled", "groupUserRole", "groupMemberInitialRole", "contactIncognitoCantInvite", "groupIncognitoCantInvite", "groupContactRole", "groupDuplicateMember", "groupDuplicateMemberId", "groupNotJoined", "groupMemberNotActive", "cantBlockMemberForSelf", "groupMemberUserRemoved", "groupMemberNotFound", "groupCantResendInvitation", "groupInternal", "fileNotFound", "fileSize", "fileAlreadyReceiving", "fileCancelled", "fileCancel", "fileAlreadyExists", "fileWrite", "fileSend", "fileRcvChunk", "fileInternal", "fileImageType", "fileImageSize", "fileNotReceived", "fileNotApproved", "fallbackToSMPProhibited", "inlineFileProhibited", "invalidForward", "invalidChatItemUpdate", "invalidChatItemDelete", "hasCurrentCall", "noCurrentCall", "callContact", "directMessagesProhibited", "agentVersion", "agentNoSubResult", "commandError", "agentCommandError", "invalidFileDescription", "connectionIncognitoChangeProhibited", "connectionUserChangeProhibited", "peerChatVRangeIncompatible", "relayTestError", "internalError", "exception"]
|
||||
|
||||
ChatFeature = Literal["timedMessages", "fullDelete", "reactions", "voice", "files", "calls", "sessions"]
|
||||
|
||||
@@ -1428,7 +1432,6 @@ class ContactAddressPlan_ok(TypedDict):
|
||||
type: Literal["ok"]
|
||||
contactSLinkData_: NotRequired["ContactShortLinkData"]
|
||||
ownerVerification: NotRequired["OwnerVerification"]
|
||||
verifiedDomain: NotRequired["SimplexDomain"]
|
||||
|
||||
class ContactAddressPlan_ownLink(TypedDict):
|
||||
type: Literal["ownLink"]
|
||||
@@ -1868,7 +1871,6 @@ class GroupLinkPlan_ok(TypedDict):
|
||||
groupSLinkInfo_: NotRequired["GroupShortLinkInfo"]
|
||||
groupSLinkData_: NotRequired["GroupShortLinkData"]
|
||||
ownerVerification: NotRequired["OwnerVerification"]
|
||||
verifiedDomain: NotRequired["SimplexDomain"]
|
||||
|
||||
class GroupLinkPlan_ownLink(TypedDict):
|
||||
type: Literal["ownLink"]
|
||||
@@ -2338,6 +2340,8 @@ class PendingContactConnection(TypedDict):
|
||||
createdAt: str # ISO-8601 timestamp
|
||||
updatedAt: str # ISO-8601 timestamp
|
||||
|
||||
PlanResolveMode = Literal["allGroups", "unknown", "never"]
|
||||
|
||||
class PrefEnabled(TypedDict):
|
||||
forUser: bool
|
||||
forContact: bool
|
||||
|
||||
Reference in New Issue
Block a user