mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
20 lines
497 B
Swift
20 lines
497 B
Swift
import Foundation
|
|
import Postbox
|
|
import TelegramApi
|
|
|
|
|
|
extension RestrictionRule {
|
|
convenience init(apiReason: Api.RestrictionReason) {
|
|
switch apiReason {
|
|
case let .restrictionReason(platform, reason, text):
|
|
self.init(platform: platform, reason: reason, text: text)
|
|
}
|
|
}
|
|
}
|
|
|
|
extension PeerAccessRestrictionInfo {
|
|
convenience init(apiReasons: [Api.RestrictionReason]) {
|
|
self.init(rules: apiReasons.map(RestrictionRule.init(apiReason:)))
|
|
}
|
|
}
|