Various improvements

This commit is contained in:
Isaac
2024-08-14 23:52:04 +08:00
parent 45f7a631c6
commit d8d7264772
5 changed files with 14 additions and 7 deletions

View File

@@ -75,6 +75,13 @@ private func messagesShouldBeMerged(accountPeerId: PeerId, _ lhs: Message, _ rhs
}
}
if let channel = lhs.peers[lhs.id.peerId] as? TelegramChannel, case let .broadcast(info) = channel.info {
if info.flags.contains(.messagesShouldHaveProfiles) {
lhsEffectiveAuthor = lhs.author
rhsEffectiveAuthor = rhs.author
}
}
var sameChat = true
if lhs.id.peerId != rhs.id.peerId {
sameChat = false
@@ -344,7 +351,7 @@ public final class ChatMessageItemImpl: ChatMessageItem, CustomStringConvertible
if !hasActionMedia {
if !isBroadcastChannel {
hasAvatar = true
} else if let channel = message.peers[message.id.peerId] as? TelegramChannel, case let .broadcast(info) = channel.info, message.author?.id != channel.id {
} else if let channel = message.peers[message.id.peerId] as? TelegramChannel, case let .broadcast(info) = channel.info {
if info.flags.contains(.messagesShouldHaveProfiles) {
hasAvatar = true
effectiveAuthor = message.author