mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-04 21:41:45 +00:00
Don't delete remote messages when deleting local ones
This commit is contained in:
parent
4b8f054575
commit
74fbca5705
@ -35,7 +35,15 @@ public func deleteMessagesInteractively(postbox: Postbox, messageIds initialMess
|
||||
}
|
||||
for (peerId, peerMessageIds) in messageIdsByPeerId {
|
||||
if peerId.namespace == Namespaces.Peer.CloudChannel || peerId.namespace == Namespaces.Peer.CloudGroup || peerId.namespace == Namespaces.Peer.CloudUser {
|
||||
cloudChatAddRemoveMessagesOperation(transaction: transaction, peerId: peerId, messageIds: peerMessageIds, type: CloudChatRemoveMessagesType(type))
|
||||
let remoteMessageIds = peerMessageIds.filter { id in
|
||||
if id.namespace == Namespaces.Message.Local {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
if !remoteMessageIds.isEmpty {
|
||||
cloudChatAddRemoveMessagesOperation(transaction: transaction, peerId: peerId, messageIds: remoteMessageIds, type: CloudChatRemoveMessagesType(type))
|
||||
}
|
||||
} else if peerId.namespace == Namespaces.Peer.SecretChat {
|
||||
if let state = transaction.getPeerChatState(peerId) as? SecretChatState {
|
||||
var layer: SecretChatLayer?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user