Skip to content

Commit

Permalink
adapt to new strings, can only delete e2ee messages
Browse files Browse the repository at this point in the history
  • Loading branch information
r10s committed Feb 26, 2025
1 parent 88e8ddb commit d4fcd63
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions deltachat-ios/Chat/ChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,8 @@ class ChatViewController: UITableViewController, UITableViewDropDelegate {
var canDeleteForEveryone = true
if dcChat.canSend && !dcChat.isSelfTalk {
for msgId in ids {
if !dcContext.getMessage(id: msgId).isFromCurrentSender {
let msg = dcContext.getMessage(id: msgId)
if !msg.isFromCurrentSender || !msg.showPadlock() {
canDeleteForEveryone = false
break
}
Expand All @@ -1310,13 +1311,13 @@ class ChatViewController: UITableViewController, UITableViewDropDelegate {
canDeleteForEveryone = false
}

let alert = UIAlertController(title: String.localized(stringID: "ask_delete_messages_simple", parameter: ids.count), message: nil, preferredStyle: .safeActionSheet)
alert.addAction(UIAlertAction(title: "Delete for Me", style: .destructive, handler: { _ in
let alert = UIAlertController(title: String.localized(stringID: "ask_delete_messages", parameter: ids.count), message: nil, preferredStyle: .safeActionSheet)
alert.addAction(UIAlertAction(title: String.localized("delete_for_me"), style: .destructive, handler: { _ in
self.dcContext.deleteMessages(msgIds: ids)
deleteInUi(ids: ids)
}))
if canDeleteForEveryone {
alert.addAction(UIAlertAction(title: "Delete for Everyone", style: .destructive, handler: { _ in
alert.addAction(UIAlertAction(title: String.localized("delete_for_everyone"), style: .destructive, handler: { _ in
self.dcContext.sendDeleteRequest(msgIds: ids)
deleteInUi(ids: ids)
}))
Expand Down

0 comments on commit d4fcd63

Please sign in to comment.