mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-08 08:31:13 +00:00
Fix build
This commit is contained in:
parent
a1c0ce4df4
commit
0051d8977e
@ -207,7 +207,14 @@ public func chatTranslationState(context: AccountContext, peerId: EnginePeer.Id)
|
||||
for message in messages {
|
||||
if message.effectivelyIncoming(context.account.peerId), message.text.count >= 10 {
|
||||
var text = String(message.text.prefix(256))
|
||||
if var entities = message.textEntitiesAttribute?.entities.filter({ [.Pre, .Code, .Url, .Email, .Mention, .Hashtag, .BotCommand].contains($0.type) }) {
|
||||
if var entities = message.textEntitiesAttribute?.entities.filter({ entity in
|
||||
switch entity.type {
|
||||
case .Pre, .Code, .Url, .Email, .Mention, .Hashtag, .BotCommand:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}) {
|
||||
entities = entities.sorted(by: { $0.range.lowerBound > $1.range.lowerBound })
|
||||
var ranges: [Range<String.Index>] = []
|
||||
for entity in entities {
|
||||
|
Loading…
x
Reference in New Issue
Block a user