mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
26 lines
596 B
Swift
26 lines
596 B
Swift
import Foundation
|
|
#if os(macOS)
|
|
import PostboxMac
|
|
import TelegramApiMac
|
|
#else
|
|
import Postbox
|
|
import TelegramApi
|
|
#endif
|
|
|
|
import SyncCore
|
|
|
|
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:)))
|
|
}
|
|
}
|