mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-07 13:35:09 +00:00
Update submodules
This commit is contained in:
@@ -198,7 +198,6 @@ final class SharedNotificationManager {
|
||||
let aps = payload["aps"] as? [AnyHashable: Any]
|
||||
|
||||
var readMessageId: MessageId?
|
||||
var removedMessageId: MessageId?
|
||||
var isCall = false
|
||||
var isAnnouncement = false
|
||||
var isLocationPolling = false
|
||||
@@ -208,6 +207,7 @@ final class SharedNotificationManager {
|
||||
var body: String?
|
||||
var apnsSound: String?
|
||||
var configurationUpdate: (Int32, String, Int32, Data?)?
|
||||
var messagesDeleted: [MessageId] = []
|
||||
if let aps = aps, let alert = aps["alert"] as? String {
|
||||
if let range = alert.range(of: ": ") {
|
||||
title = String(alert[..<range.lowerBound])
|
||||
@@ -229,6 +229,27 @@ final class SharedNotificationManager {
|
||||
isLocationPolling = true
|
||||
} else if locKey == "MESSAGE_MUTED" {
|
||||
isMutePolling = true
|
||||
} else if locKey == "MESSAGE_DELETED" {
|
||||
var peerId: PeerId?
|
||||
if let fromId = payload["from_id"] {
|
||||
let fromIdValue = fromId as! NSString
|
||||
peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: Int32(fromIdValue.intValue))
|
||||
} else if let fromId = payload["chat_id"] {
|
||||
let fromIdValue = fromId as! NSString
|
||||
peerId = PeerId(namespace: Namespaces.Peer.CloudGroup, id: Int32(fromIdValue.intValue))
|
||||
} else if let fromId = payload["channel_id"] {
|
||||
let fromIdValue = fromId as! NSString
|
||||
peerId = PeerId(namespace: Namespaces.Peer.CloudChannel, id: Int32(fromIdValue.intValue))
|
||||
}
|
||||
if let peerId = peerId {
|
||||
if let messageIds = payload["messages"] as? String {
|
||||
for messageId in messageIds.split(separator: ",") {
|
||||
if let messageIdValue = Int32(messageId) {
|
||||
messagesDeleted.append(MessageId(peerId: peerId, namespace: Namespaces.Message.Cloud, id: messageIdValue))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let string = NSLocalizedString(locKey, comment: "")
|
||||
if !string.isEmpty {
|
||||
@@ -360,13 +381,26 @@ final class SharedNotificationManager {
|
||||
|
||||
if let readMessageId = readMessageId {
|
||||
self.clearNotificationsManager?.append(readMessageId)
|
||||
self.clearNotificationsManager?.commitNow()
|
||||
|
||||
let _ = account.postbox.transaction(ignoreDisabled: true, { transaction -> Void in
|
||||
transaction.applyIncomingReadMaxId(readMessageId)
|
||||
}).start()
|
||||
}
|
||||
|
||||
for messageId in messagesDeleted {
|
||||
self.clearNotificationsManager?.append(messageId)
|
||||
}
|
||||
|
||||
if !messagesDeleted.isEmpty {
|
||||
let _ = account.postbox.transaction(ignoreDisabled: true, { transaction -> Void in
|
||||
transaction.deleteMessages(messagesDeleted)
|
||||
}).start()
|
||||
}
|
||||
|
||||
if readMessageId != nil || !messagesDeleted.isEmpty {
|
||||
self.clearNotificationsManager?.commitNow()
|
||||
}
|
||||
|
||||
if let (datacenterId, host, port, secret) = configurationUpdate {
|
||||
account.network.mergeBackupDatacenterAddress(datacenterId: datacenterId, host: host, port: port, secret: secret)
|
||||
}
|
||||
|
||||
Submodule submodules/Display updated: 108a074f74...99638081bf
Submodule submodules/TelegramCore updated: 4fb2baa71e...2309c6b129
Submodule submodules/TelegramUI updated: 1998a756c9...d4df959464
Reference in New Issue
Block a user