core, ui: require update for public groups (#7009)

This commit is contained in:
spaced4ndy
2026-05-26 09:03:41 +00:00
committed by GitHub
parent ff36d401ce
commit 12fbf61f32
12 changed files with 97 additions and 15 deletions
@@ -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 {
@@ -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>