mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
no message
This commit is contained in:
@@ -66,19 +66,25 @@ class ChatMessageMediaBubbleContentNode: ChatMessageBubbleContentNode {
|
||||
localtime_r(&t, &timeinfo)
|
||||
|
||||
var edited = false
|
||||
var sentViaBot = false
|
||||
var viewCount: Int?
|
||||
for attribute in item.message.attributes {
|
||||
if let _ = attribute as? EditedMessageAttribute {
|
||||
edited = true
|
||||
} else if let attribute = attribute as? ViewCountMessageAttribute {
|
||||
viewCount = attribute.count
|
||||
} else if let _ = attribute as? InlineBotMessageAttribute {
|
||||
sentViaBot = true
|
||||
}
|
||||
}
|
||||
var dateText = String(format: "%02d:%02d", arguments: [Int(timeinfo.tm_hour), Int(timeinfo.tm_min)])
|
||||
if let author = item.message.author as? TelegramUser, author.botInfo != nil {
|
||||
sentViaBot = true
|
||||
}
|
||||
let dateText = String(format: "%02d:%02d", arguments: [Int(timeinfo.tm_hour), Int(timeinfo.tm_min)])
|
||||
|
||||
let statusType: ChatMessageDateAndStatusType?
|
||||
if case .None = position.bottom {
|
||||
if item.message.flags.contains(.Incoming) {
|
||||
if item.message.effectivelyIncoming {
|
||||
statusType = .ImageIncoming
|
||||
} else {
|
||||
if item.message.flags.contains(.Failed) {
|
||||
@@ -99,7 +105,7 @@ class ChatMessageMediaBubbleContentNode: ChatMessageBubbleContentNode {
|
||||
var statusApply: ((Bool) -> Void)?
|
||||
|
||||
if let statusType = statusType {
|
||||
let (size, apply) = statusLayout(edited, viewCount, dateText, statusType, CGSize(width: imageLayoutSize.width, height: CGFloat.greatestFiniteMagnitude))
|
||||
let (size, apply) = statusLayout(edited && !sentViaBot, viewCount, dateText, statusType, CGSize(width: imageLayoutSize.width, height: CGFloat.greatestFiniteMagnitude))
|
||||
statusSize = size
|
||||
statusApply = apply
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user