Ignore topic data in chat list and notifications when chat is not a forum anymore

This commit is contained in:
Ilya Laktyushin 2023-03-23 19:43:11 +04:00
parent af36deaac6
commit 3eb2ccb1a5
2 changed files with 11 additions and 3 deletions

View File

@ -1953,6 +1953,9 @@ public func messagesForNotification(transaction: Transaction, id: MessageId, alw
} }
if let channel = message.peers[message.id.peerId] as? TelegramChannel { if let channel = message.peers[message.id.peerId] as? TelegramChannel {
if !channel.flags.contains(.isForum) {
threadData = nil
}
switch channel.participationStatus { switch channel.participationStatus {
case .kicked, .left: case .kicked, .left:
return ([], false, sound, false, threadData) return ([], false, sound, false, threadData)

View File

@ -457,8 +457,13 @@ extension EngineChatList.Item {
let readCounters = readState.flatMap(EnginePeerReadCounters.init) let readCounters = readState.flatMap(EnginePeerReadCounters.init)
if let channel = renderedPeer.peer as? TelegramChannel, channel.flags.contains(.isForum) { if let channel = renderedPeer.peer as? TelegramChannel {
if channel.flags.contains(.isForum) {
draft = nil draft = nil
} else {
forumTopicDataValue = nil
topForumTopicItems = []
}
} }
self.init( self.init(