mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
17 lines
642 B
Swift
17 lines
642 B
Swift
import Foundation
|
|
import Postbox
|
|
import TelegramApi
|
|
|
|
import SyncCore
|
|
|
|
extension ExportedInvitation {
|
|
init?(apiExportedInvite: Api.ExportedChatInvite) {
|
|
switch apiExportedInvite {
|
|
case .chatInviteEmpty:
|
|
return nil
|
|
case let .chatInviteExported(flags, link, adminId, date, expireDate, usageLimit, usage):
|
|
self = ExportedInvitation(link: link, isPermanent: (flags & (1 << 5)) != 0, isRevoked: (flags & (1 << 0)) != 0, adminId: PeerId(namespace: Namespaces.Peer.CloudUser, id: adminId), date: date, expireDate: expireDate, usageLimit: usageLimit, count: usage)
|
|
}
|
|
}
|
|
}
|