mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Forum bug fixes
This commit is contained in:
parent
49202b59d8
commit
9b1f295d4e
@ -136,7 +136,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
|
||||
|
||||
private let headerContentView = ComponentView<Empty>()
|
||||
|
||||
private var primaryContext: ChatListLocationContext?
|
||||
fileprivate private(set) var primaryContext: ChatListLocationContext?
|
||||
private let primaryInfoReady = Promise<Bool>()
|
||||
|
||||
private var pendingSecondaryContext: ChatListLocationContext?
|
||||
@ -4744,10 +4744,11 @@ private final class ChatListLocationContext {
|
||||
self.rightButton = AnyComponentWithIdentity(id: "more", component: AnyComponent(NavigationButtonComponent(
|
||||
content: .more,
|
||||
pressed: { [weak parentController] sourceView in
|
||||
guard let secondaryContext = parentController?.secondaryContext else {
|
||||
return
|
||||
if let secondaryContext = parentController?.secondaryContext {
|
||||
secondaryContext.performMoreAction(sourceView: sourceView)
|
||||
} else if let primaryContext = parentController?.primaryContext {
|
||||
primaryContext.performMoreAction(sourceView: sourceView)
|
||||
}
|
||||
secondaryContext.performMoreAction(sourceView: sourceView)
|
||||
},
|
||||
contextAction: { [weak self] sourceView, gesture in
|
||||
guard let self, let parentController = self.parentController else {
|
||||
|
@ -272,7 +272,7 @@ private final class ChatListShimmerNode: ASDisplayNode {
|
||||
|
||||
if !isInlineMode {
|
||||
if !itemNodes[sampleIndex].avatarNode.isHidden {
|
||||
context.fillEllipse(in: itemNodes[sampleIndex].avatarNode.frame.offsetBy(dx: 0.0, dy: currentY))
|
||||
context.fillEllipse(in: itemNodes[sampleIndex].avatarNode.view.convert(itemNodes[sampleIndex].avatarNode.bounds, to: itemNodes[sampleIndex].view).offsetBy(dx: 0.0, dy: currentY))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4069,14 +4069,18 @@ func replayFinalState(
|
||||
}
|
||||
})
|
||||
}
|
||||
case let .UpdateAutoremoveTimeout(peer, value):
|
||||
transaction.updatePeerCachedData(peerIds: Set([peer.peerId]), update: { _, current in
|
||||
if let current = current as? CachedUserData {
|
||||
return current.withUpdatedAutoremoveTimeout(.known(value))
|
||||
} else if let current = current as? CachedGroupData {
|
||||
return current.withUpdatedAutoremoveTimeout(.known(value))
|
||||
} else if let current = current as? CachedChannelData {
|
||||
return current.withUpdatedAutoremoveTimeout(.known(value))
|
||||
case let .UpdateAutoremoveTimeout(peer, autoremoveValue):
|
||||
let peerId = peer.peerId
|
||||
transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in
|
||||
if peerId.namespace == Namespaces.Peer.CloudUser {
|
||||
let current = (current as? CachedUserData) ?? CachedUserData()
|
||||
return current.withUpdatedAutoremoveTimeout(.known(autoremoveValue))
|
||||
} else if peerId.namespace == Namespaces.Peer.CloudChannel {
|
||||
let current = (current as? CachedChannelData) ?? CachedChannelData()
|
||||
return current.withUpdatedAutoremoveTimeout(.known(autoremoveValue))
|
||||
} else if peerId.namespace == Namespaces.Peer.CloudGroup {
|
||||
let current = (current as? CachedGroupData) ?? CachedGroupData()
|
||||
return current.withUpdatedAutoremoveTimeout(.known(autoremoveValue))
|
||||
} else {
|
||||
return current
|
||||
}
|
||||
|
@ -820,11 +820,14 @@ func fetchChatListHole(postbox: Postbox, network: Network, accountPeerId: PeerId
|
||||
|
||||
for (peerId, autoremoveValue) in fetchedChats.ttlPeriods {
|
||||
transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in
|
||||
if let current = current as? CachedUserData {
|
||||
if peerId.namespace == Namespaces.Peer.CloudUser {
|
||||
let current = (current as? CachedUserData) ?? CachedUserData()
|
||||
return current.withUpdatedAutoremoveTimeout(autoremoveValue)
|
||||
} else if let current = current as? CachedGroupData {
|
||||
} else if peerId.namespace == Namespaces.Peer.CloudChannel {
|
||||
let current = (current as? CachedChannelData) ?? CachedChannelData()
|
||||
return current.withUpdatedAutoremoveTimeout(autoremoveValue)
|
||||
} else if let current = current as? CachedChannelData {
|
||||
} else if peerId.namespace == Namespaces.Peer.CloudGroup {
|
||||
let current = (current as? CachedGroupData) ?? CachedGroupData()
|
||||
return current.withUpdatedAutoremoveTimeout(autoremoveValue)
|
||||
} else {
|
||||
return current
|
||||
|
@ -236,11 +236,14 @@ private func synchronizePinnedChats(transaction: Transaction, postbox: Postbox,
|
||||
|
||||
for (peerId, autoremoveValue) in ttlPeriods {
|
||||
transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in
|
||||
if let current = current as? CachedUserData {
|
||||
if peerId.namespace == Namespaces.Peer.CloudUser {
|
||||
let current = (current as? CachedUserData) ?? CachedUserData()
|
||||
return current.withUpdatedAutoremoveTimeout(autoremoveValue)
|
||||
} else if let current = current as? CachedGroupData {
|
||||
} else if peerId.namespace == Namespaces.Peer.CloudChannel {
|
||||
let current = (current as? CachedChannelData) ?? CachedChannelData()
|
||||
return current.withUpdatedAutoremoveTimeout(autoremoveValue)
|
||||
} else if let current = current as? CachedChannelData {
|
||||
} else if peerId.namespace == Namespaces.Peer.CloudGroup {
|
||||
let current = (current as? CachedGroupData) ?? CachedGroupData()
|
||||
return current.withUpdatedAutoremoveTimeout(autoremoveValue)
|
||||
} else {
|
||||
return current
|
||||
|
@ -190,11 +190,14 @@ func _internal_setChatMessageAutoremoveTimeoutInteractively(account: Account, pe
|
||||
updatedTimeout = .known(nil)
|
||||
}
|
||||
|
||||
if let current = current as? CachedUserData {
|
||||
if peerId.namespace == Namespaces.Peer.CloudUser {
|
||||
let current = (current as? CachedUserData) ?? CachedUserData()
|
||||
return current.withUpdatedAutoremoveTimeout(updatedTimeout)
|
||||
} else if let current = current as? CachedGroupData {
|
||||
} else if peerId.namespace == Namespaces.Peer.CloudChannel {
|
||||
let current = (current as? CachedChannelData) ?? CachedChannelData()
|
||||
return current.withUpdatedAutoremoveTimeout(updatedTimeout)
|
||||
} else if let current = current as? CachedChannelData {
|
||||
} else if peerId.namespace == Namespaces.Peer.CloudGroup {
|
||||
let current = (current as? CachedGroupData) ?? CachedGroupData()
|
||||
return current.withUpdatedAutoremoveTimeout(updatedTimeout)
|
||||
} else {
|
||||
return current
|
||||
|
@ -769,11 +769,14 @@ private func loadAndStorePeerChatInfos(accountPeerId: PeerId, postbox: Postbox,
|
||||
|
||||
for (peerId, autoremoveValue) in ttlPeriods {
|
||||
transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in
|
||||
if let current = current as? CachedUserData {
|
||||
if peerId.namespace == Namespaces.Peer.CloudUser {
|
||||
let current = (current as? CachedUserData) ?? CachedUserData()
|
||||
return current.withUpdatedAutoremoveTimeout(autoremoveValue)
|
||||
} else if let current = current as? CachedGroupData {
|
||||
} else if peerId.namespace == Namespaces.Peer.CloudChannel {
|
||||
let current = (current as? CachedChannelData) ?? CachedChannelData()
|
||||
return current.withUpdatedAutoremoveTimeout(autoremoveValue)
|
||||
} else if let current = current as? CachedChannelData {
|
||||
} else if peerId.namespace == Namespaces.Peer.CloudGroup {
|
||||
let current = (current as? CachedGroupData) ?? CachedGroupData()
|
||||
return current.withUpdatedAutoremoveTimeout(autoremoveValue)
|
||||
} else {
|
||||
return current
|
||||
|
Loading…
x
Reference in New Issue
Block a user