mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Various Fixes
This commit is contained in:
@@ -782,15 +782,15 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
||||
|
||||
let isFailed = item.content.firstMessage.effectivelyFailed(timestamp: item.context.account.network.getApproximateRemoteTimestamp())
|
||||
|
||||
var needShareButton = false
|
||||
var needsShareButton = false
|
||||
if case .pinnedMessages = item.associatedData.subject {
|
||||
needShareButton = true
|
||||
needsShareButton = true
|
||||
} else if isFailed || Namespaces.Message.allScheduled.contains(item.message.id.namespace) {
|
||||
needShareButton = false
|
||||
needsShareButton = false
|
||||
} else if item.message.id.peerId.isRepliesOrSavedMessages(accountPeerId: item.context.account.peerId) {
|
||||
for attribute in item.content.firstMessage.attributes {
|
||||
if let _ = attribute as? SourceReferenceMessageAttribute {
|
||||
needShareButton = true
|
||||
needsShareButton = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -798,31 +798,35 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
||||
if let peer = item.message.peers[item.message.id.peerId] {
|
||||
if let channel = peer as? TelegramChannel {
|
||||
if case .broadcast = channel.info {
|
||||
needShareButton = true
|
||||
needsShareButton = true
|
||||
}
|
||||
}
|
||||
}
|
||||
if !needShareButton, let author = item.message.author as? TelegramUser, let _ = author.botInfo, !item.message.media.isEmpty {
|
||||
needShareButton = true
|
||||
if !needsShareButton, let author = item.message.author as? TelegramUser, let _ = author.botInfo, !item.message.media.isEmpty {
|
||||
needsShareButton = true
|
||||
}
|
||||
if !needShareButton {
|
||||
if !needsShareButton {
|
||||
loop: for media in item.message.media {
|
||||
if media is TelegramMediaGame || media is TelegramMediaInvoice {
|
||||
needShareButton = true
|
||||
needsShareButton = true
|
||||
break loop
|
||||
} else if let media = media as? TelegramMediaWebpage, case .Loaded = media.content {
|
||||
needShareButton = true
|
||||
needsShareButton = true
|
||||
break loop
|
||||
}
|
||||
}
|
||||
} else {
|
||||
loop: for media in item.message.media {
|
||||
if media is TelegramMediaAction {
|
||||
needShareButton = false
|
||||
needsShareButton = false
|
||||
break loop
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if item.associatedData.isCopyProtectionEnabled {
|
||||
needsShareButton = false
|
||||
}
|
||||
}
|
||||
|
||||
var layoutInsets = UIEdgeInsets(top: mergedTop.merged ? layoutConstants.bubble.mergedSpacing : layoutConstants.bubble.defaultSpacing, left: 0.0, bottom: mergedBottom.merged ? layoutConstants.bubble.mergedSpacing : layoutConstants.bubble.defaultSpacing, right: 0.0)
|
||||
@@ -955,7 +959,7 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
||||
}
|
||||
|
||||
var updatedShareButtonNode: ChatMessageShareButton?
|
||||
if needShareButton {
|
||||
if needsShareButton {
|
||||
if let currentShareButtonNode = currentShareButtonNode {
|
||||
updatedShareButtonNode = currentShareButtonNode
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user