mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Pre-release improvements
This commit is contained in:
@@ -129,14 +129,16 @@ private func pushPeerNotificationSettings(postbox: Postbox, network: Network, pe
|
||||
}
|
||||
let inputSettings = Api.InputPeerNotifySettings.inputPeerNotifySettings(flags: flags, showPreviews: showPreviews, silent: nil, muteUntil: muteUntil, sound: sound)
|
||||
return network.request(Api.functions.account.updateNotifySettings(peer: .inputNotifyPeer(peer: inputPeer), settings: inputSettings))
|
||||
|> retryRequest
|
||||
|> mapToSignal { result -> Signal<Void, NoError> in
|
||||
return postbox.transaction { transaction -> Void in
|
||||
transaction.updateCurrentPeerNotificationSettings([notificationPeerId: settings])
|
||||
if let pending = transaction.getPendingPeerNotificationSettings(peerId), pending.isEqual(to: settings) {
|
||||
transaction.updatePendingPeerNotificationSettings(peerId: peerId, settings: nil)
|
||||
}
|
||||
|> `catch` { _ -> Signal<Api.Bool, NoError> in
|
||||
return .single(.boolFalse)
|
||||
}
|
||||
|> mapToSignal { result -> Signal<Void, NoError> in
|
||||
return postbox.transaction { transaction -> Void in
|
||||
transaction.updateCurrentPeerNotificationSettings([notificationPeerId: settings])
|
||||
if let pending = transaction.getPendingPeerNotificationSettings(peerId), pending.isEqual(to: settings) {
|
||||
transaction.updatePendingPeerNotificationSettings(peerId: peerId, settings: nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if let pending = transaction.getPendingPeerNotificationSettings(peerId), pending.isEqual(to: settings) {
|
||||
|
||||
Reference in New Issue
Block a user