mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
40 lines
1.1 KiB
Swift
40 lines
1.1 KiB
Swift
import SwiftSignalKit
|
|
import Postbox
|
|
import TelegramApi
|
|
|
|
public extension TelegramEngineUnauthorized {
|
|
final class Auth {
|
|
private let account: UnauthorizedAccount
|
|
|
|
init(account: UnauthorizedAccount) {
|
|
self.account = account
|
|
}
|
|
|
|
public func exportAuthTransferToken(accountManager: AccountManager, otherAccountUserIds: [PeerId.Id], syncContacts: Bool) -> Signal<ExportAuthTransferTokenResult, ExportAuthTransferTokenError> {
|
|
return _internal_exportAuthTransferToken(accountManager: accountManager, account: self.account, otherAccountUserIds: otherAccountUserIds, syncContacts: syncContacts)
|
|
}
|
|
}
|
|
}
|
|
|
|
public enum DeleteAccountError {
|
|
case generic
|
|
}
|
|
|
|
public extension TelegramEngine {
|
|
final class Auth {
|
|
private let account: Account
|
|
|
|
init(account: Account) {
|
|
self.account = account
|
|
}
|
|
|
|
public func deleteAccount() -> Signal<Never, DeleteAccountError> {
|
|
return self.account.network.request(Api.functions.account.deleteAccount(reason: "GDPR"))
|
|
|> mapError { _ -> DeleteAccountError in
|
|
return .generic
|
|
}
|
|
|> ignoreValues
|
|
}
|
|
}
|
|
}
|