Add force to get_user_full.
GitOrigin-RevId: 182ab8a99142a12c51662ee0928480f6a3e03f91
This commit is contained in:
parent
9df4c5dcf9
commit
1d8004d279
@ -11576,7 +11576,7 @@ void ContactsManager::reload_user(UserId user_id, Promise<Unit> &&promise) {
|
|||||||
td_->create_handler<GetUsersQuery>(std::move(promise))->send(std::move(users));
|
td_->create_handler<GetUsersQuery>(std::move(promise))->send(std::move(users));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContactsManager::get_user_full(UserId user_id, Promise<Unit> &&promise) {
|
bool ContactsManager::get_user_full(UserId user_id, bool force, Promise<Unit> &&promise) {
|
||||||
auto u = get_user(user_id);
|
auto u = get_user(user_id);
|
||||||
if (u == nullptr) {
|
if (u == nullptr) {
|
||||||
promise.set_error(Status::Error(6, "User not found"));
|
promise.set_error(Status::Error(6, "User not found"));
|
||||||
@ -11597,7 +11597,7 @@ bool ContactsManager::get_user_full(UserId user_id, Promise<Unit> &&promise) {
|
|||||||
if (user_full->is_expired() || is_bot_info_expired(user_id, u->bot_info_version)) {
|
if (user_full->is_expired() || is_bot_info_expired(user_id, u->bot_info_version)) {
|
||||||
auto input_user = get_input_user(user_id);
|
auto input_user = get_input_user(user_id);
|
||||||
CHECK(input_user != nullptr);
|
CHECK(input_user != nullptr);
|
||||||
if (td_->auth_manager_->is_bot()) {
|
if (td_->auth_manager_->is_bot() && !force) {
|
||||||
send_get_user_full_query(user_id, std::move(input_user), std::move(promise), "get expired user_full");
|
send_get_user_full_query(user_id, std::move(input_user), std::move(promise), "get expired user_full");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -428,7 +428,7 @@ class ContactsManager : public Actor {
|
|||||||
UserId get_me(Promise<Unit> &&promise);
|
UserId get_me(Promise<Unit> &&promise);
|
||||||
bool get_user(UserId user_id, int left_tries, Promise<Unit> &&promise);
|
bool get_user(UserId user_id, int left_tries, Promise<Unit> &&promise);
|
||||||
void reload_user(UserId user_id, Promise<Unit> &&promise);
|
void reload_user(UserId user_id, Promise<Unit> &&promise);
|
||||||
bool get_user_full(UserId user_id, Promise<Unit> &&promise);
|
bool get_user_full(UserId user_id, bool force, Promise<Unit> &&promise);
|
||||||
void reload_user_full(UserId user_id);
|
void reload_user_full(UserId user_id);
|
||||||
|
|
||||||
std::pair<int32, vector<const Photo *>> get_user_profile_photos(UserId user_id, int32 offset, int32 limit,
|
std::pair<int32, vector<const Photo *>> get_user_profile_photos(UserId user_id, int32 offset, int32 limit,
|
||||||
|
@ -13764,7 +13764,7 @@ MessageId MessagesManager::get_replied_message(DialogId dialog_id, MessageId mes
|
|||||||
void MessagesManager::get_dialog_info_full(DialogId dialog_id, Promise<Unit> &&promise) {
|
void MessagesManager::get_dialog_info_full(DialogId dialog_id, Promise<Unit> &&promise) {
|
||||||
switch (dialog_id.get_type()) {
|
switch (dialog_id.get_type()) {
|
||||||
case DialogType::User:
|
case DialogType::User:
|
||||||
td_->contacts_manager_->get_user_full(dialog_id.get_user_id(), std::move(promise));
|
td_->contacts_manager_->get_user_full(dialog_id.get_user_id(), false, std::move(promise));
|
||||||
return;
|
return;
|
||||||
case DialogType::Chat:
|
case DialogType::Chat:
|
||||||
td_->contacts_manager_->get_chat_full(dialog_id.get_chat_id(), false, std::move(promise));
|
td_->contacts_manager_->get_chat_full(dialog_id.get_chat_id(), false, std::move(promise));
|
||||||
|
@ -678,7 +678,7 @@ class GetUserFullInfoRequest : public RequestActor<> {
|
|||||||
UserId user_id_;
|
UserId user_id_;
|
||||||
|
|
||||||
void do_run(Promise<Unit> &&promise) override {
|
void do_run(Promise<Unit> &&promise) override {
|
||||||
td->contacts_manager_->get_user_full(user_id_, std::move(promise));
|
td->contacts_manager_->get_user_full(user_id_, get_tries() < 2, std::move(promise));
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_send_result() override {
|
void do_send_result() override {
|
||||||
|
Reference in New Issue
Block a user