Generic error dialog for tapping any group-change chat events in ended group
This commit is contained in:
parent
3d776f00c4
commit
11602703c9
@ -1016,6 +1016,10 @@ private extension ConversationViewController {
|
||||
return nil
|
||||
}
|
||||
|
||||
guard !thread.isTerminatedGroup else {
|
||||
return nil
|
||||
}
|
||||
|
||||
// We will skip this read if the above checks fail, which will be most of the time.
|
||||
guard
|
||||
SSKEnvironment.shared.databaseStorageRef.read(block: { tx in
|
||||
|
||||
@ -1041,6 +1041,11 @@ extension ConversationViewController: CVComponentDelegate {
|
||||
public func didTapShowConversationSettingsAndShowMemberRequests() {
|
||||
AssertIsOnMainThread()
|
||||
|
||||
if thread.isTerminatedGroup {
|
||||
showUnableToTakeActionInEndedGroupSheet()
|
||||
return
|
||||
}
|
||||
|
||||
showConversationSettingsAndShowMemberRequests()
|
||||
}
|
||||
|
||||
@ -1051,6 +1056,11 @@ extension ConversationViewController: CVComponentDelegate {
|
||||
) {
|
||||
AssertIsOnMainThread()
|
||||
|
||||
if thread.isTerminatedGroup {
|
||||
showUnableToTakeActionInEndedGroupSheet()
|
||||
return
|
||||
}
|
||||
|
||||
let actionSheet = ActionSheetController(
|
||||
title: OWSLocalizedString(
|
||||
"GROUPS_BLOCK_REQUEST_SHEET_TITLE",
|
||||
|
||||
@ -437,7 +437,7 @@ public extension ConversationViewController {
|
||||
}
|
||||
|
||||
if groupThread.isTerminatedGroup {
|
||||
showUnableToInviteSheet()
|
||||
showUnableToTakeActionInEndedGroupSheet()
|
||||
return
|
||||
}
|
||||
|
||||
@ -448,12 +448,12 @@ public extension ConversationViewController {
|
||||
view.present(fromViewController: self)
|
||||
}
|
||||
|
||||
func showUnableToInviteSheet() {
|
||||
func showUnableToTakeActionInEndedGroupSheet() {
|
||||
let alert = ActionSheetController(
|
||||
title: nil,
|
||||
message: OWSLocalizedString(
|
||||
"END_GROUP_INVITE_ERROR",
|
||||
comment: "Description for error sheet that says the user can no longer invite friends or add members to a group.",
|
||||
"END_GROUP_ACTION_ERROR",
|
||||
comment: "Description for error sheet that says the user can no longer take this action because the group has ended.",
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@ -3433,6 +3433,9 @@
|
||||
/* Call setup status label */
|
||||
"END_CALL_UNCATEGORIZED_FAILURE" = "Call failed";
|
||||
|
||||
/* Description for error sheet that says the user can no longer take this action because the group has ended. */
|
||||
"END_GROUP_ACTION_ERROR" = "This action is unavailable because the group has ended.";
|
||||
|
||||
/* Label for a banner in group settings indicating that the group has been ended */
|
||||
"END_GROUP_BANNER_LABEL" = "This group was ended.";
|
||||
|
||||
@ -3448,9 +3451,6 @@
|
||||
/* Body for error sheet shown if the group failed to end */
|
||||
"END_GROUP_ERROR_DESCRIPTION" = "Ending the group failed. Check your connection and try again.";
|
||||
|
||||
/* Description for error sheet that says the user can no longer invite friends or add members to a group. */
|
||||
"END_GROUP_INVITE_ERROR" = "You can no longer invite friends or add members to this group.";
|
||||
|
||||
/* Label in conversation settings to end a group */
|
||||
"END_GROUP_LABEL" = "End Group";
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user