mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-06-03 19:11:37 +00:00
core, ui: require update for public groups (#7009)
This commit is contained in:
+1
@@ -6993,6 +6993,7 @@ sealed class GroupLinkPlan {
|
||||
@Serializable @SerialName("connectingProhibit") class ConnectingProhibit(val groupInfo_: GroupInfo? = null): GroupLinkPlan()
|
||||
@Serializable @SerialName("known") class Known(val groupInfo: GroupInfo): GroupLinkPlan()
|
||||
@Serializable @SerialName("noRelays") class NoRelays(val groupSLinkData_: GroupShortLinkData? = null): GroupLinkPlan()
|
||||
@Serializable @SerialName("updateRequired") class UpdateRequired(val groupSLinkData_: GroupShortLinkData? = null): GroupLinkPlan()
|
||||
}
|
||||
|
||||
abstract class TerminalItem {
|
||||
|
||||
+27
@@ -316,6 +316,33 @@ private suspend fun planAndConnectTask(
|
||||
cleanup()
|
||||
}
|
||||
}
|
||||
is GroupLinkPlan.UpdateRequired -> {
|
||||
Log.d(TAG, "planAndConnect, .GroupLink, .UpdateRequired")
|
||||
val groupSLinkData = connectionPlan.groupLinkPlan.groupSLinkData_
|
||||
if (groupSLinkData != null) {
|
||||
AlertManager.privacySensitive.showOpenChatAlert(
|
||||
profileName = groupSLinkData.groupProfile.displayName,
|
||||
profileFullName = groupSLinkData.groupProfile.fullName,
|
||||
profileImage = {
|
||||
ProfileImage(
|
||||
size = alertProfileImageSize,
|
||||
image = groupSLinkData.groupProfile.image,
|
||||
icon = MR.images.ic_supervised_user_circle_filled
|
||||
)
|
||||
},
|
||||
subtitle = generalGetString(MR.strings.group_link_requires_newer_version),
|
||||
confirmText = null,
|
||||
dismissText = generalGetString(MR.strings.ok),
|
||||
onDismiss = { cleanup() }
|
||||
)
|
||||
} else {
|
||||
AlertManager.privacySensitive.showAlertMsg(
|
||||
generalGetString(MR.strings.app_update_required),
|
||||
generalGetString(MR.strings.group_link_requires_newer_version)
|
||||
)
|
||||
cleanup()
|
||||
}
|
||||
}
|
||||
}
|
||||
is ConnectionPlan.Error -> {
|
||||
Log.d(TAG, "planAndConnect, error ${connectionPlan.chatError}")
|
||||
|
||||
@@ -196,6 +196,8 @@
|
||||
<string name="link_requires_newer_app_version_please_upgrade">This link requires a newer app version. Please upgrade the app or ask your contact to send a compatible link.</string>
|
||||
<string name="channel_temporarily_unavailable">Channel temporarily unavailable</string>
|
||||
<string name="channel_no_active_relays_try_later">Channel has no active relays. Please try to join later.</string>
|
||||
<string name="app_update_required">App update required</string>
|
||||
<string name="group_link_requires_newer_version">This group requires a newer version of the app. Please update the app to join.</string>
|
||||
<string name="connection_error_auth">Connection error (AUTH)</string>
|
||||
<string name="connection_error_auth_desc">Unless your contact deleted the connection or this link was already used, it might be a bug - please report it.\nTo connect, please ask your contact to create another connection link and check that you have a stable network connection.</string>
|
||||
<string name="connection_error_blocked">Connection blocked</string>
|
||||
|
||||
Reference in New Issue
Block a user