mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-03 13:13:55 +00:00
Fix exception list
This commit is contained in:
parent
051380c565
commit
12c85a9968
@ -18,10 +18,13 @@ public final class NotificationExceptionsList: Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
func _internal_notificationExceptionsList(accountPeerId: PeerId, postbox: Postbox, network: Network) -> Signal<NotificationExceptionsList, NoError> {
|
||||
func _internal_notificationExceptionsList(accountPeerId: PeerId, postbox: Postbox, network: Network, isStories: Bool) -> Signal<NotificationExceptionsList, NoError> {
|
||||
var flags: Int32 = 0
|
||||
flags |= 1 << 1
|
||||
flags |= 1 << 2
|
||||
if isStories {
|
||||
flags |= 1 << 2
|
||||
} else {
|
||||
flags |= 1 << 1
|
||||
}
|
||||
|
||||
return network.request(Api.functions.account.getNotifyExceptions(flags: flags, peer: nil))
|
||||
|> retryRequest
|
||||
|
||||
@ -637,7 +637,16 @@ public extension TelegramEngine {
|
||||
}
|
||||
|
||||
public func notificationExceptionsList() -> Signal<NotificationExceptionsList, NoError> {
|
||||
return _internal_notificationExceptionsList(accountPeerId: self.account.peerId, postbox: self.account.postbox, network: self.account.network)
|
||||
return combineLatest(
|
||||
_internal_notificationExceptionsList(accountPeerId: self.account.peerId, postbox: self.account.postbox, network: self.account.network, isStories: false),
|
||||
_internal_notificationExceptionsList(accountPeerId: self.account.peerId, postbox: self.account.postbox, network: self.account.network, isStories: true)
|
||||
)
|
||||
|> map { lhs, rhs in
|
||||
return NotificationExceptionsList(
|
||||
peers: lhs.peers.merging(rhs.peers, uniquingKeysWith: { a, _ in a }),
|
||||
settings: lhs.settings.merging(rhs.settings, uniquingKeysWith: { a, _ in a })
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
public func fetchAndUpdateCachedPeerData(peerId: PeerId) -> Signal<Bool, NoError> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user