2
0
mirror of https://github.com/tdlib/telegram-bot-api synced 2025-08-22 01:49:24 +00:00

Add ChatFullInfo.parent_chat for direct messages chats.

This commit is contained in:
levlam 2025-06-13 16:04:08 +03:00
parent 2ae55e1fc8
commit 58ed3b6666
2 changed files with 5 additions and 0 deletions

View File

@ -1292,6 +1292,9 @@ class Client::JsonChat final : public td::Jsonable {
if (supergroup_info->linked_chat_id != 0) {
object("linked_chat_id", supergroup_info->linked_chat_id);
}
if (supergroup_info->is_direct_messages && supergroup_info->direct_messages_chat_id != 0) {
object("parent_chat", JsonChat(supergroup_info->direct_messages_chat_id, client_));
}
if (supergroup_info->location != nullptr) {
object("location", JsonChatLocation(supergroup_info->location.get()));
}
@ -8008,6 +8011,7 @@ void Client::on_update(object_ptr<td_api::Object> result) {
supergroup_info->slow_mode_delay = full_info->slow_mode_delay_;
supergroup_info->unrestrict_boost_count = full_info->unrestrict_boost_count_;
supergroup_info->linked_chat_id = full_info->linked_chat_id_;
supergroup_info->direct_messages_chat_id = full_info->direct_messages_chat_id_;
supergroup_info->location = std::move(full_info->location_);
supergroup_info->has_hidden_members = full_info->has_hidden_members_;
supergroup_info->has_aggressive_anti_spam_enabled = full_info->has_aggressive_anti_spam_enabled_;

View File

@ -969,6 +969,7 @@ class Client final : public WebhookActor::Callback {
int32 slow_mode_delay = 0;
int32 unrestrict_boost_count = 0;
int64 linked_chat_id = 0;
int64 direct_messages_chat_id = 0;
object_ptr<td_api::chatLocation> location;
object_ptr<td_api::ChatMemberStatus> status;
bool is_supergroup = false;