mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Giveaway improvements
This commit is contained in:
@@ -17,6 +17,7 @@ public enum EngineMedia: Equatable {
|
||||
case webFile(TelegramMediaWebFile)
|
||||
case webpage(TelegramMediaWebpage)
|
||||
case story(TelegramMediaStory)
|
||||
case giveaway(TelegramMediaGiveaway)
|
||||
}
|
||||
|
||||
public extension EngineMedia {
|
||||
@@ -50,6 +51,8 @@ public extension EngineMedia {
|
||||
return webpage.id
|
||||
case let .story(story):
|
||||
return story.id
|
||||
case let .giveaway(giveaway):
|
||||
return giveaway.id
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -85,6 +88,8 @@ public extension EngineMedia {
|
||||
self = .webpage(webpage)
|
||||
case let story as TelegramMediaStory:
|
||||
self = .story(story)
|
||||
case let giveaway as TelegramMediaGiveaway:
|
||||
self = .giveaway(giveaway)
|
||||
default:
|
||||
preconditionFailure()
|
||||
}
|
||||
@@ -120,6 +125,8 @@ public extension EngineMedia {
|
||||
return webpage
|
||||
case let .story(story):
|
||||
return story
|
||||
case let .giveaway(giveaway):
|
||||
return giveaway
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user