Browse Source

show chat title in delete confirmation dialog (#1421)

* show chat title in delete confirmation dialog

esp. when deleting from the chatlist with a swipe,
there is some chance that one accidentally swipes the wrong chat -
and deletes the wrong chat then.

the title makes clear what the 'this' in 'Delete this chat?' actually means.

* update to ask_delete_chat_desktop; ask_delete_chat_desktop is outdated anyway can can be deleted
bjoern 3 years ago
parent
commit
5e8f33a4a3

+ 1 - 1
deltachat-ios/Controller/ChatListController.swift

@@ -478,7 +478,7 @@ class ChatListController: UITableViewController {
     private func showDeleteChatConfirmationAlert(chatId: Int) {
         let alert = UIAlertController(
             title: nil,
-            message: String.localized("ask_delete_chat_desktop"),
+            message: String.localizedStringWithFormat(String.localized("ask_delete_named_chat"), dcContext.getChat(chatId: chatId).name),
             preferredStyle: .safeActionSheet
         )
         alert.addAction(UIAlertAction(title: String.localized("menu_delete_chat"), style: .destructive, handler: { _ in

+ 1 - 1
deltachat-ios/Controller/ContactDetailViewController.swift

@@ -394,7 +394,7 @@ class ContactDetailViewController: UITableViewController {
     private func showDeleteChatConfirmationAlert() {
         let alert = UIAlertController(
             title: nil,
-            message: String.localized("ask_delete_chat_desktop"),
+            message: String.localizedStringWithFormat(String.localized("ask_delete_named_chat"), viewModel.context.getChat(chatId: viewModel.chatId).name),
             preferredStyle: .safeActionSheet
         )
         alert.addAction(UIAlertAction(title: String.localized("menu_delete_chat"), style: .destructive, handler: { _ in

+ 1 - 1
deltachat-ios/Controller/GroupChatDetailViewController.swift

@@ -686,7 +686,7 @@ extension GroupChatDetailViewController {
     private func showDeleteChatConfirmationAlert() {
         let alert = UIAlertController(
             title: nil,
-            message: String.localized("ask_delete_chat_desktop"),
+            message: String.localizedStringWithFormat(String.localized("ask_delete_named_chat"), dcContext.getChat(chatId: chatId).name),
             preferredStyle: .safeActionSheet
         )
         alert.addAction(UIAlertAction(title: String.localized("menu_delete_chat"), style: .destructive, handler: { _ in