mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-04 13:38:21 +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
|
var flags: Int32 = 0
|
||||||
flags |= 1 << 1
|
if isStories {
|
||||||
flags |= 1 << 2
|
flags |= 1 << 2
|
||||||
|
} else {
|
||||||
|
flags |= 1 << 1
|
||||||
|
}
|
||||||
|
|
||||||
return network.request(Api.functions.account.getNotifyExceptions(flags: flags, peer: nil))
|
return network.request(Api.functions.account.getNotifyExceptions(flags: flags, peer: nil))
|
||||||
|> retryRequest
|
|> retryRequest
|
||||||
|
|||||||
@ -637,7 +637,16 @@ public extension TelegramEngine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func notificationExceptionsList() -> Signal<NotificationExceptionsList, NoError> {
|
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> {
|
public func fetchAndUpdateCachedPeerData(peerId: PeerId) -> Signal<Bool, NoError> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user