Fix SplitSource build.
GitOrigin-RevId: 09aa9993fa30af502cae2cd0a5efe77444112b3c
This commit is contained in:
parent
30e47390aa
commit
5b26485ede
@ -157,6 +157,7 @@ function split_file($file, $chunks, $undo) {
|
||||
'(CREATE_REQUEST|CREATE_NO_ARGS_REQUEST)[(](?<name>[A-Z][A-Za-z]*)|'.
|
||||
'(?<name>complete_pending_preauthentication_requests)|'.
|
||||
'(Up|Down)load[a-zA-Z]*C(?<name>allback)|(up|down)load_[a-z_]*_c(?<name>allback)_|'.
|
||||
'(?<name>lazy_to_json)|'.
|
||||
'(?<name>LogEvent)[^sA]|'.
|
||||
'(?<name>parse)[(]|'.
|
||||
'(?<name>store)[(]/', $f, $matches, PREG_SET_ORDER)) {
|
||||
|
@ -125,20 +125,6 @@ class GetAccountTtlQuery : public Td::ResultHandler {
|
||||
}
|
||||
};
|
||||
|
||||
static td_api::object_ptr<td_api::session> convert_authorization_object(
|
||||
tl_object_ptr<telegram_api::authorization> &&authorization) {
|
||||
CHECK(authorization != nullptr);
|
||||
bool is_current = (authorization->flags_ & telegram_api::authorization::CURRENT_MASK) != 0;
|
||||
bool is_official_application = (authorization->flags_ & telegram_api::authorization::OFFICIAL_APP_MASK) != 0;
|
||||
bool is_password_pending = (authorization->flags_ & telegram_api::authorization::PASSWORD_PENDING_MASK) != 0;
|
||||
|
||||
return td_api::make_object<td_api::session>(
|
||||
authorization->hash_, is_current, is_password_pending, authorization->api_id_, authorization->app_name_,
|
||||
authorization->app_version_, is_official_application, authorization->device_model_, authorization->platform_,
|
||||
authorization->system_version_, authorization->date_created_, authorization->date_active_, authorization->ip_,
|
||||
authorization->country_, authorization->region_);
|
||||
}
|
||||
|
||||
class AcceptLoginTokenQuery : public Td::ResultHandler {
|
||||
Promise<td_api::object_ptr<td_api::session>> promise_;
|
||||
|
||||
@ -159,7 +145,7 @@ class AcceptLoginTokenQuery : public Td::ResultHandler {
|
||||
}
|
||||
|
||||
LOG(DEBUG) << "Receive result for AcceptLoginTokenQuery: " << to_string(result_ptr.ok());
|
||||
promise_.set_value(convert_authorization_object(result_ptr.move_as_ok()));
|
||||
promise_.set_value(ContactsManager::convert_authorization_object(result_ptr.move_as_ok()));
|
||||
}
|
||||
|
||||
void on_error(uint64 id, Status status) override {
|
||||
@ -187,8 +173,8 @@ class GetAuthorizationsQuery : public Td::ResultHandler {
|
||||
auto ptr = result_ptr.move_as_ok();
|
||||
LOG(INFO) << "Receive result for GetAuthorizationsQuery: " << to_string(ptr);
|
||||
|
||||
auto results =
|
||||
make_tl_object<td_api::sessions>(transform(std::move(ptr->authorizations_), convert_authorization_object));
|
||||
auto results = make_tl_object<td_api::sessions>(
|
||||
transform(std::move(ptr->authorizations_), ContactsManager::convert_authorization_object));
|
||||
std::sort(results->sessions_.begin(), results->sessions_.end(),
|
||||
[](const td_api::object_ptr<td_api::session> &lhs, const td_api::object_ptr<td_api::session> &rhs) {
|
||||
if (lhs->is_current_ != rhs->is_current_) {
|
||||
@ -4139,6 +4125,20 @@ void ContactsManager::get_account_ttl(Promise<int32> &&promise) const {
|
||||
td_->create_handler<GetAccountTtlQuery>(std::move(promise))->send();
|
||||
}
|
||||
|
||||
td_api::object_ptr<td_api::session> ContactsManager::convert_authorization_object(
|
||||
tl_object_ptr<telegram_api::authorization> &&authorization) {
|
||||
CHECK(authorization != nullptr);
|
||||
bool is_current = (authorization->flags_ & telegram_api::authorization::CURRENT_MASK) != 0;
|
||||
bool is_official_application = (authorization->flags_ & telegram_api::authorization::OFFICIAL_APP_MASK) != 0;
|
||||
bool is_password_pending = (authorization->flags_ & telegram_api::authorization::PASSWORD_PENDING_MASK) != 0;
|
||||
|
||||
return td_api::make_object<td_api::session>(
|
||||
authorization->hash_, is_current, is_password_pending, authorization->api_id_, authorization->app_name_,
|
||||
authorization->app_version_, is_official_application, authorization->device_model_, authorization->platform_,
|
||||
authorization->system_version_, authorization->date_created_, authorization->date_active_, authorization->ip_,
|
||||
authorization->country_, authorization->region_);
|
||||
}
|
||||
|
||||
void ContactsManager::confirm_qr_code_authentication(string link,
|
||||
Promise<td_api::object_ptr<td_api::session>> &&promise) {
|
||||
Slice prefix("tg://login?token=");
|
||||
|
@ -264,6 +264,9 @@ class ContactsManager : public Actor {
|
||||
void set_account_ttl(int32 account_ttl, Promise<Unit> &&promise) const;
|
||||
void get_account_ttl(Promise<int32> &&promise) const;
|
||||
|
||||
static td_api::object_ptr<td_api::session> convert_authorization_object(
|
||||
tl_object_ptr<telegram_api::authorization> &&authorization);
|
||||
|
||||
void confirm_qr_code_authentication(string link, Promise<td_api::object_ptr<td_api::session>> &&promise);
|
||||
|
||||
void get_active_sessions(Promise<tl_object_ptr<td_api::sessions>> &&promise) const;
|
||||
|
Loading…
Reference in New Issue
Block a user