mirror of
https://github.com/tdlight-team/tdlight-telegram-bot-api.git
synced 2024-12-29 13:45:49 +01:00
Store td_api::businessInfo in UserInfo.
This commit is contained in:
parent
3d54e3c43b
commit
f852504301
@ -935,14 +935,17 @@ class Client::JsonChat final : public td::Jsonable {
|
||||
if (user_info->has_restricted_voice_and_video_messages) {
|
||||
object("has_restricted_voice_and_video_messages", td::JsonTrue());
|
||||
}
|
||||
if (user_info->business_intro != nullptr) {
|
||||
object("business_intro", JsonBusinessIntro(user_info->business_intro.get(), client_));
|
||||
if (user_info->business_info != nullptr) {
|
||||
auto business_info = user_info->business_info.get();
|
||||
if (business_info->intro_ != nullptr) {
|
||||
object("business_intro", JsonBusinessIntro(business_info->intro_.get(), client_));
|
||||
}
|
||||
if (user_info->business_location != nullptr) {
|
||||
object("business_location", JsonBusinessLocation(user_info->business_location.get()));
|
||||
if (business_info->location_ != nullptr) {
|
||||
object("business_location", JsonBusinessLocation(business_info->location_.get()));
|
||||
}
|
||||
if (business_info->opening_hours_ != nullptr) {
|
||||
object("business_opening_hours", JsonBusinessOpeningHours(business_info->opening_hours_.get()));
|
||||
}
|
||||
if (user_info->business_opening_hours != nullptr) {
|
||||
object("business_opening_hours", JsonBusinessOpeningHours(user_info->business_opening_hours.get()));
|
||||
}
|
||||
}
|
||||
photo = user_info->photo.get();
|
||||
@ -6423,17 +6426,7 @@ void Client::on_update(object_ptr<td_api::Object> result) {
|
||||
user_info->photo =
|
||||
full_info->photo_ == nullptr ? std::move(full_info->public_photo_) : std::move(full_info->photo_);
|
||||
user_info->bio = full_info->bio_ != nullptr ? std::move(full_info->bio_->text_) : td::string();
|
||||
user_info->business_intro = full_info->business_info_ != nullptr && full_info->business_info_->intro_ != nullptr
|
||||
? std::move(full_info->business_info_->intro_)
|
||||
: nullptr;
|
||||
user_info->business_location =
|
||||
full_info->business_info_ != nullptr && full_info->business_info_->location_ != nullptr
|
||||
? std::move(full_info->business_info_->location_)
|
||||
: nullptr;
|
||||
user_info->business_opening_hours =
|
||||
full_info->business_info_ != nullptr && full_info->business_info_->opening_hours_ != nullptr
|
||||
? std::move(full_info->business_info_->opening_hours_)
|
||||
: nullptr;
|
||||
user_info->business_info = std::move(full_info->business_info_);
|
||||
user_info->has_private_forwards = full_info->has_private_forwards_;
|
||||
user_info->has_restricted_voice_and_video_messages = full_info->has_restricted_voice_and_video_note_messages_;
|
||||
break;
|
||||
|
@ -798,9 +798,7 @@ class Client final : public WebhookActor::Callback {
|
||||
|
||||
object_ptr<td_api::chatPhoto> photo;
|
||||
td::string bio;
|
||||
object_ptr<td_api::businessIntro> business_intro;
|
||||
object_ptr<td_api::businessLocation> business_location;
|
||||
object_ptr<td_api::businessOpeningHours> business_opening_hours;
|
||||
object_ptr<td_api::businessInfo> business_info;
|
||||
|
||||
bool have_access = false;
|
||||
bool can_join_groups = false;
|
||||
|
Loading…
Reference in New Issue
Block a user