mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-03 19:54:31 +00:00
Fix secret chat message parsing
This commit is contained in:
@@ -110,6 +110,7 @@ func processSecretChatIncomingDecryptedOperations(mediaBox: MediaBox, transactio
|
||||
if let operation = entry.contents as? SecretChatIncomingDecryptedOperation {
|
||||
do {
|
||||
var message: StoreMessage?
|
||||
var contentParsingError = false
|
||||
var resources: [(MediaResource, Data)] = []
|
||||
var serviceAction: SecretChatServiceAction?
|
||||
|
||||
@@ -147,7 +148,7 @@ func processSecretChatIncomingDecryptedOperations(mediaBox: MediaBox, transactio
|
||||
}
|
||||
serviceAction = SecretChatServiceAction(apiMessage)
|
||||
} else {
|
||||
throw MessageParsingError.contentParsingError
|
||||
contentParsingError = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,6 +289,8 @@ func processSecretChatIncomingDecryptedOperations(mediaBox: MediaBox, transactio
|
||||
}
|
||||
let _ = transaction.addMessages([message], location: .Random)
|
||||
addedMessages.append(message)
|
||||
} else if contentParsingError {
|
||||
Logger.shared.log("SecretChat", "Couldn't parse secret message content")
|
||||
}
|
||||
} catch let error {
|
||||
if let error = error as? MessageParsingError {
|
||||
|
||||
@@ -80,6 +80,8 @@ public func updatePeers(transaction: Transaction, peers: [Peer], update: (Peer?,
|
||||
}
|
||||
case .left:
|
||||
updatedInclusion = .never
|
||||
case .kicked where channel.creationDate == 0:
|
||||
updatedInclusion = .never
|
||||
default:
|
||||
if currentInclusion == .notSpecified {
|
||||
updatedInclusion = .never
|
||||
|
||||
Reference in New Issue
Block a user