mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Various improvements
This commit is contained in:
@@ -843,7 +843,7 @@ public class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
||||
if peerId != item.context.account.peerId {
|
||||
if peerId.isGroupOrChannel && item.message.author != nil {
|
||||
if let peer = item.message.peers[item.message.id.peerId] as? TelegramChannel, case let .broadcast(info) = peer.info {
|
||||
if item.message.author?.id != peer.id, info.flags.contains(.messagesShouldHaveProfiles) {
|
||||
if info.flags.contains(.messagesShouldHaveProfiles) {
|
||||
hasAvatar = incoming
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1550,7 +1550,7 @@ public class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewI
|
||||
}
|
||||
}
|
||||
|
||||
if let channel = firstMessage.peers[firstMessage.id.peerId] as? TelegramChannel, case let .broadcast(info) = channel.info, firstMessage.author?.id != channel.id {
|
||||
if let channel = firstMessage.peers[firstMessage.id.peerId] as? TelegramChannel, case let .broadcast(info) = channel.info {
|
||||
if info.flags.contains(.messagesShouldHaveProfiles) {
|
||||
var allowAuthor = incoming
|
||||
overrideEffectiveAuthor = true
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -465,7 +465,7 @@ public class ChatMessageStickerItemNode: ChatMessageItemView {
|
||||
if !peerId.isRepliesOrSavedMessages(accountPeerId: item.context.account.peerId) {
|
||||
if peerId.isGroupOrChannel && item.message.author != nil {
|
||||
if let peer = item.message.peers[item.message.id.peerId] as? TelegramChannel, case let .broadcast(info) = peer.info {
|
||||
if item.message.author?.id != peer.id, info.flags.contains(.messagesShouldHaveProfiles) {
|
||||
if info.flags.contains(.messagesShouldHaveProfiles) {
|
||||
hasAvatar = incoming
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1684,10 +1684,10 @@ private final class ChatSendStarsScreenComponent: Component {
|
||||
self.topPeerItems[topPeer.id] = itemView
|
||||
}
|
||||
|
||||
var itemCountString = "\(topPeer.count)"
|
||||
if topPeer.isMy && myCountAddition != 0 && topPeer.count > myCountAddition {
|
||||
let itemCountString = "\(topPeer.count)"
|
||||
/*if topPeer.isMy && myCountAddition != 0 && topPeer.count > myCountAddition {
|
||||
itemCountString = "\(topPeer.count - myCountAddition) +\(myCountAddition)"
|
||||
}
|
||||
}*/
|
||||
|
||||
let itemSize = itemView.update(
|
||||
transition: .immediate,
|
||||
|
||||
Reference in New Issue
Block a user