From ae168143ca33a6e04a4bd32ea8df35c083303c97 Mon Sep 17 00:00:00 2001
From: "Evgeny @ SimpleX Chat"
<259188159+evgeny-simplex@users.noreply.github.com>
Date: Tue, 30 Jun 2026 16:43:17 +0000
Subject: [PATCH] kotlin alerts
---
.../chat/simplex/common/model/SimpleXAPI.kt | 41 +++++++++++++++----
.../commonMain/resources/MR/base/strings.xml | 16 +++++---
2 files changed, 42 insertions(+), 15 deletions(-)
diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt
index 217964326a..d7a942445b 100644
--- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt
+++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt
@@ -1559,25 +1559,44 @@ object ChatController {
}
r is API.Error && r.err is ChatError.ChatErrorChat
&& r.err.errorType is ChatErrorType.SimplexName -> {
+ val name = r.err.errorType.simplexName.shortName
if (r.err.errorType.simplexNameError is SimplexNameError.NoValidLink) {
AlertManager.shared.showAlertMsg(
- generalGetString(MR.strings.cannot_reconnect_via_simplex_name),
- generalGetString(MR.strings.simplex_name_unprepared_desc)
+ generalGetString(MR.strings.simplex_name_no_valid_link),
+ generalGetString(MR.strings.simplex_name_no_valid_link_desc).format(name)
)
} else {
AlertManager.shared.showAlertMsg(
- generalGetString(MR.strings.simplex_name_not_found),
- generalGetString(MR.strings.simplex_name_not_found_desc)
+ generalGetString(MR.strings.simplex_name_unconfirmed),
+ generalGetString(MR.strings.simplex_name_unconfirmed_desc).format(name)
)
}
}
r is API.Error && r.err is ChatError.ChatErrorAgent
&& r.err.agentError is AgentErrorType.NO_NAME_SERVERS -> {
AlertManager.shared.showAlertMsg(
- generalGetString(MR.strings.simplex_name_resolution_unavailable),
- generalGetString(MR.strings.simplex_name_resolver_unavailable_desc)
+ generalGetString(MR.strings.simplex_name_error),
+ generalGetString(MR.strings.simplex_name_no_servers_desc)
)
}
+ r is API.Error && r.err is ChatError.ChatErrorAgent
+ && r.err.agentError is AgentErrorType.SMP
+ && r.err.agentError.smpErr is SMPErrorType.NAME -> {
+ when (val nameErr = r.err.agentError.smpErr.nameErr) {
+ is NameErrorType.NOT_FOUND -> AlertManager.shared.showAlertMsg(
+ generalGetString(MR.strings.simplex_name_not_found),
+ generalGetString(MR.strings.simplex_name_not_found_desc)
+ )
+ is NameErrorType.NO_RESOLVER -> AlertManager.shared.showAlertMsg(
+ generalGetString(MR.strings.simplex_name_error),
+ generalGetString(MR.strings.simplex_name_server_no_resolver_desc).format(r.err.agentError.serverAddress)
+ )
+ is NameErrorType.RESOLVER -> AlertManager.shared.showAlertMsg(
+ generalGetString(MR.strings.simplex_name_error),
+ generalGetString(MR.strings.simplex_name_resolver_error_desc).format(nameErr.resolverErr)
+ )
+ }
+ }
r is API.Error && r.err is ChatError.ChatErrorAgent
&& r.err.agentError is AgentErrorType.SMP
&& r.err.agentError.smpErr is SMPErrorType.AUTH -> {
@@ -1617,10 +1636,14 @@ object ChatController {
generalGetString(MR.strings.unsupported_connection_link)
e is ChatError.ChatErrorChat && e.errorType is ChatErrorType.SimplexName ->
if (e.errorType.simplexNameError is SimplexNameError.NoValidLink)
- generalGetString(MR.strings.cannot_reconnect_via_simplex_name)
- else generalGetString(MR.strings.simplex_name_not_found)
+ generalGetString(MR.strings.simplex_name_no_valid_link)
+ else generalGetString(MR.strings.simplex_name_unconfirmed)
e is ChatError.ChatErrorAgent && e.agentError is AgentErrorType.NO_NAME_SERVERS ->
- generalGetString(MR.strings.simplex_name_resolution_unavailable)
+ generalGetString(MR.strings.simplex_name_error)
+ e is ChatError.ChatErrorAgent && e.agentError is AgentErrorType.SMP && e.agentError.smpErr is SMPErrorType.NAME ->
+ if (e.agentError.smpErr.nameErr is NameErrorType.NOT_FOUND)
+ generalGetString(MR.strings.simplex_name_not_found)
+ else generalGetString(MR.strings.simplex_name_error)
e is ChatError.ChatErrorAgent && e.agentError is AgentErrorType.SMP && e.agentError.smpErr is SMPErrorType.AUTH ->
generalGetString(MR.strings.connection_error_auth)
e is ChatError.ChatErrorAgent && e.agentError is AgentErrorType.SMP && e.agentError.smpErr is SMPErrorType.BLOCKED ->
diff --git a/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml b/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml
index 9ff7996770..15b6433223 100644
--- a/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml
+++ b/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml
@@ -200,12 +200,16 @@
Connecting via channel name requires a newer app version.
Connecting via contact name requires a newer app version.
Please upgrade the app.
- SimpleX name not found
- There is no contact or group registered with this SimpleX name.
- Cannot reconnect via name
- This SimpleX name is known but has no saved link to reconnect via.
- Name resolution unavailable
- None of your SMP servers support resolving SimpleX names. Add a server that does, or use a connection link.
+ SimpleX name error
+ None of your servers are set to resolve SimpleX names. Configure servers, or use a connection link.
+ Server %1$s does not support name resolution. Configure servers, or use a connection link.
+ Name not found
+ This SimpleX name is not registered. Please check the name.
+ Resolver error: %1$s
+ No valid link
+ The SimpleX name %1$s is registered, but it has no valid link.
+ Unconfirmed name
+ The SimpleX name %1$s is registered, but not added to profile. Please add it to your address or channel profile, if you are the owner.
Channel temporarily unavailable
Channel has no active relays. Please try to join later.
App update required