mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Possibly fix unwanted users in stories feed
This commit is contained in:
parent
e8a6df7bbf
commit
dd06ff38d0
@ -59,7 +59,7 @@ public func updatePeers(transaction: Transaction, peers: [Peer], update: (Peer?,
|
|||||||
var (state, peerIds) = transaction.getAllStorySubscriptions(key: .filtered)
|
var (state, peerIds) = transaction.getAllStorySubscriptions(key: .filtered)
|
||||||
peerIds.removeAll(where: { $0 == updated.id })
|
peerIds.removeAll(where: { $0 == updated.id })
|
||||||
transaction.replaceAllStorySubscriptions(key: .filtered, state: state, peerIds: peerIds)
|
transaction.replaceAllStorySubscriptions(key: .filtered, state: state, peerIds: peerIds)
|
||||||
}
|
|
||||||
if !transaction.storySubscriptionsContains(key: .hidden, peerId: updated.id) {
|
if !transaction.storySubscriptionsContains(key: .hidden, peerId: updated.id) {
|
||||||
var (state, peerIds) = transaction.getAllStorySubscriptions(key: .hidden)
|
var (state, peerIds) = transaction.getAllStorySubscriptions(key: .hidden)
|
||||||
if !peerIds.contains(updated.id) {
|
if !peerIds.contains(updated.id) {
|
||||||
@ -67,12 +67,13 @@ public func updatePeers(transaction: Transaction, peers: [Peer], update: (Peer?,
|
|||||||
transaction.replaceAllStorySubscriptions(key: .hidden, state: state, peerIds: peerIds)
|
transaction.replaceAllStorySubscriptions(key: .hidden, state: state, peerIds: peerIds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if transaction.storySubscriptionsContains(key: .hidden, peerId: updated.id) {
|
if transaction.storySubscriptionsContains(key: .hidden, peerId: updated.id) {
|
||||||
var (state, peerIds) = transaction.getAllStorySubscriptions(key: .hidden)
|
var (state, peerIds) = transaction.getAllStorySubscriptions(key: .hidden)
|
||||||
peerIds.removeAll(where: { $0 == updated.id })
|
peerIds.removeAll(where: { $0 == updated.id })
|
||||||
transaction.replaceAllStorySubscriptions(key: .hidden, state: state, peerIds: peerIds)
|
transaction.replaceAllStorySubscriptions(key: .hidden, state: state, peerIds: peerIds)
|
||||||
}
|
|
||||||
if !transaction.storySubscriptionsContains(key: .filtered, peerId: updated.id) {
|
if !transaction.storySubscriptionsContains(key: .filtered, peerId: updated.id) {
|
||||||
var (state, peerIds) = transaction.getAllStorySubscriptions(key: .filtered)
|
var (state, peerIds) = transaction.getAllStorySubscriptions(key: .filtered)
|
||||||
if !peerIds.contains(updated.id) {
|
if !peerIds.contains(updated.id) {
|
||||||
@ -82,6 +83,7 @@ public func updatePeers(transaction: Transaction, peers: [Peer], update: (Peer?,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
case Namespaces.Peer.CloudGroup:
|
case Namespaces.Peer.CloudGroup:
|
||||||
if let group = updated as? TelegramGroup {
|
if let group = updated as? TelegramGroup {
|
||||||
if group.flags.contains(.deactivated) {
|
if group.flags.contains(.deactivated) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user