mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Various improvements
This commit is contained in:
parent
a63a3074bd
commit
383ab9e479
33 changed files with 373 additions and 203 deletions
|
|
@ -642,3 +642,22 @@ public func _internal_parseMediaAttachment(data: Data) -> Media? {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
public extension Message {
|
||||
func messageEffect(availableMessageEffects: AvailableMessageEffects?) -> AvailableMessageEffects.MessageEffect? {
|
||||
guard let availableMessageEffects else {
|
||||
return nil
|
||||
}
|
||||
for attribute in self.attributes {
|
||||
if let attribute = attribute as? EffectMessageAttribute {
|
||||
for effect in availableMessageEffects.messageEffects {
|
||||
if effect.id == attribute.id {
|
||||
return effect
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue