no message

This commit is contained in:
Peter
2017-03-21 19:58:11 +03:00
parent c5d34b17f0
commit 2707eea1c3
111 changed files with 7305 additions and 856 deletions

View File

@@ -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
}