Fix g++4.9 CE.

GitOrigin-RevId: dbe44c308021c68f7c750618947dd5643f0789ea
This commit is contained in:
levlam 2018-08-14 16:44:31 +03:00
parent f411737f1c
commit 85bb2d8e19
3 changed files with 11 additions and 10 deletions

View File

@ -67,7 +67,7 @@ Result<BufferSlice> PasswordManager::calc_password_srp_hash(Slice password, Slic
BufferSlice result(v_bn.to_binary(256));
LOG(INFO) << "End password SRP hash calculation";
return result;
return std::move(result);
}
tl_object_ptr<telegram_api::InputCheckPasswordSRP> PasswordManager::get_input_check_password(

View File

@ -627,7 +627,7 @@ class GetPassportAuthorizationForm : public NetQueryCallback {
GetPassportAuthorizationForm(
ActorShared<SecureManager> parent, string password, int32 authorization_form_id, UserId bot_user_id, string scope,
string public_key,
Promise<std::pair<std::unordered_map<SecureValueType, SuitableSecureValue>, TdApiAuthorizationForm>> promise)
Promise<std::pair<std::map<SecureValueType, SuitableSecureValue>, TdApiAuthorizationForm>> promise)
: parent_(std::move(parent))
, password_(std::move(password))
, authorization_form_id_(authorization_form_id)
@ -644,7 +644,7 @@ class GetPassportAuthorizationForm : public NetQueryCallback {
UserId bot_user_id_;
string scope_;
string public_key_;
Promise<std::pair<std::unordered_map<SecureValueType, SuitableSecureValue>, TdApiAuthorizationForm>> promise_;
Promise<std::pair<std::map<SecureValueType, SuitableSecureValue>, TdApiAuthorizationForm>> promise_;
optional<secure_storage::Secret> secret_;
telegram_api::object_ptr<telegram_api::account_authorizationForm> authorization_form_;
@ -699,7 +699,7 @@ class GetPassportAuthorizationForm : public NetQueryCallback {
auto *file_manager = G()->td().get_actor_unsafe()->file_manager_.get();
vector<vector<SuitableSecureValue>> required_types;
std::unordered_map<SecureValueType, SuitableSecureValue> all_types;
std::map<SecureValueType, SuitableSecureValue> all_types;
for (auto &type_ptr : authorization_form_->required_types_) {
CHECK(type_ptr != nullptr);
vector<SuitableSecureValue> required_type;
@ -1044,7 +1044,7 @@ void SecureManager::get_passport_authorization_form(string password, UserId bot_
form.is_received = false;
auto new_promise = PromiseCreator::lambda(
[actor_id = actor_id(this), authorization_form_id, promise = std::move(promise)](
Result<std::pair<std::unordered_map<SecureValueType, SuitableSecureValue>, TdApiAuthorizationForm>>
Result<std::pair<std::map<SecureValueType, SuitableSecureValue>, TdApiAuthorizationForm>>
r_authorization_form) mutable {
send_closure(actor_id, &SecureManager::on_get_passport_authorization_form, authorization_form_id,
std::move(promise), std::move(r_authorization_form));
@ -1057,7 +1057,7 @@ void SecureManager::get_passport_authorization_form(string password, UserId bot_
void SecureManager::on_get_passport_authorization_form(
int32 authorization_form_id, Promise<TdApiAuthorizationForm> promise,
Result<std::pair<std::unordered_map<SecureValueType, SuitableSecureValue>, TdApiAuthorizationForm>>
Result<std::pair<std::map<SecureValueType, SuitableSecureValue>, TdApiAuthorizationForm>>
r_authorization_form) {
auto it = authorization_forms_.find(authorization_form_id);
CHECK(it != authorization_forms_.end());

View File

@ -19,6 +19,7 @@
#include "td/utils/Container.h"
#include "td/utils/Status.h"
#include <map>
#include <memory>
#include <unordered_map>
@ -51,8 +52,8 @@ class SecureManager : public NetQueryCallback {
private:
ActorShared<> parent_;
int32 refcnt_{1};
std::unordered_map<SecureValueType, ActorOwn<>> set_secure_value_queries_;
std::unordered_map<SecureValueType, SecureValueWithCredentials> secure_value_cache_;
std::map<SecureValueType, ActorOwn<>> set_secure_value_queries_;
std::map<SecureValueType, SecureValueWithCredentials> secure_value_cache_;
struct AuthorizationForm {
UserId bot_user_id;
@ -60,7 +61,7 @@ class SecureManager : public NetQueryCallback {
string public_key;
string payload;
bool is_received;
std::unordered_map<SecureValueType, SuitableSecureValue> options;
std::map<SecureValueType, SuitableSecureValue> options;
};
std::unordered_map<int32, AuthorizationForm> authorization_forms_;
@ -72,7 +73,7 @@ class SecureManager : public NetQueryCallback {
void on_delete_secure_value(SecureValueType type, Promise<Unit> promise, Result<Unit> result);
void on_get_passport_authorization_form(
int32 authorization_form_id, Promise<TdApiAuthorizationForm> promise,
Result<std::pair<std::unordered_map<SecureValueType, SuitableSecureValue>, TdApiAuthorizationForm>>
Result<std::pair<std::map<SecureValueType, SuitableSecureValue>, TdApiAuthorizationForm>>
r_authorization_form);
void on_result(NetQueryPtr query) override;