[WIP] Star reactions

This commit is contained in:
Isaac
2024-08-06 15:00:29 +04:00
parent 33cb344b45
commit 3ff98fd2a8
32 changed files with 589 additions and 228 deletions

View File

@@ -341,8 +341,16 @@ public final class ChatMessageItemImpl: ChatMessageItem, CustomStringConvertible
}
var hasAvatar = false
if !hasActionMedia && !isBroadcastChannel {
hasAvatar = true
if !hasActionMedia {
if !isBroadcastChannel {
hasAvatar = true
} else if let channel = message.peers[message.id.peerId] as? TelegramChannel, case let .broadcast(info) = channel.info, info.flags.contains(.messagesShouldHaveSignatures) {
//TODO:release
hasAvatar = true
if let authorSignatureAttribute = message.authorSignatureAttribute {
effectiveAuthor = TelegramUser(id: PeerId(namespace: Namespaces.Peer.Empty, id: PeerId.Id._internalFromInt64Value(Int64(authorSignatureAttribute.signature.persistentHashValue % 32))), accessHash: nil, firstName: authorSignatureAttribute.signature, lastName: nil, username: nil, phone: nil, photo: [], botInfo: nil, restrictionInfo: nil, flags: [], emojiStatus: nil, usernames: [], storiesHidden: nil, nameColor: nil, backgroundEmojiId: nil, profileColor: nil, profileBackgroundEmojiId: nil, subscriberCount: nil)
}
}
}
if hasAvatar {