mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-01 07:57:01 +00:00

git-subtree-dir: submodules/TelegramUI git-subtree-mainline: 5c1613d1048026b9e00a6ce753775cef87eb53fa git-subtree-split: fa3ac0b61a27c8dd3296518a15891a6f9750cbf2
30 lines
829 B
Swift
30 lines
829 B
Swift
import Foundation
|
|
import Postbox
|
|
import TelegramCore
|
|
|
|
extension Message {
|
|
func effectivelyIncoming(_ accountPeerId: PeerId) -> Bool {
|
|
if self.id.peerId == accountPeerId {
|
|
if self.forwardInfo != nil {
|
|
return true
|
|
} else {
|
|
return false
|
|
}
|
|
} else if self.flags.contains(.Incoming) {
|
|
return true
|
|
} else if let channel = self.peers[self.id.peerId] as? TelegramChannel, case .broadcast = channel.info {
|
|
return true
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
|
|
var elligibleForLargeEmoji: Bool {
|
|
if self.media.isEmpty && !self.text.isEmpty && self.text.containsOnlyEmoji && self.text.emojis.count < 4 {
|
|
return true
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
}
|