mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
Add secretMediaDuration: Int32?
This commit is contained in:
parent
f778a52cb5
commit
a499f59758
@ -71,4 +71,31 @@ public extension Message {
|
|||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public var secretMediaDuration: Int32? {
|
||||||
|
var found = false
|
||||||
|
for attribute in self.attributes {
|
||||||
|
if let attribute = attribute as? AutoremoveTimeoutMessageAttribute {
|
||||||
|
found = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if !found {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
for media in self.media {
|
||||||
|
switch media {
|
||||||
|
case _ as TelegramMediaImage:
|
||||||
|
return nil
|
||||||
|
case let file as TelegramMediaFile:
|
||||||
|
return file.duration
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user