Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios

This commit is contained in:
Ilya Laktyushin 2023-01-10 19:04:17 +04:00
commit 0eb6522b62
3 changed files with 18 additions and 1 deletions

View File

@ -669,7 +669,7 @@ public final class StorageBox {
let queue = self.queue
return ActionDisposable { [weak self] in
queue.async {
guard let self else {
guard let `self` = self else {
return
}
self.totalSizeSubscribers.remove(index)

View File

@ -52,6 +52,19 @@ private func makeExclusiveKeychain(id: AccountRecordId, postbox: Postbox) -> Key
})
}
func _internal_test(_ network: Network) -> Signal<Bool, String> {
return network.request(Api.functions.help.test()) |> map { result in
switch result {
case .boolFalse:
return false
case .boolTrue:
return true
}
} |> mapError { error in
return error.description
}
}
public class UnauthorizedAccount {
public let networkArguments: NetworkInitializationArguments
public let id: AccountRecordId

View File

@ -23,6 +23,10 @@ public extension TelegramEngineUnauthorized {
public func twoStepAuthData() -> Signal<TwoStepAuthData, MTRpcError> {
return _internal_twoStepAuthData(self.account.network)
}
public func test() -> Signal<Bool, String> {
return _internal_test(self.account.network)
}
public func updateTwoStepVerificationPassword(currentPassword: String?, updatedPassword: UpdatedTwoStepVerificationPassword) -> Signal<UpdateTwoStepVerificationPasswordResult, UpdateTwoStepVerificationPasswordError> {
return _internal_updateTwoStepVerificationPassword(network: self.account.network, currentPassword: currentPassword, updatedPassword: updatedPassword)