diff options
| author | levlam <levlam@telegram.org> | 2024-06-06 13:57:02 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2024-06-06 13:57:02 +0300 |
| commit | 2b0bb9207c55d440bb01bde157b41009330319f7 (patch) | |
| tree | e13767c7c653c8336a1befef996019aa0891159a | |
| parent | 221db0fa1f5c695cd020f9ec388f03ce85c855ef (diff) | |
Split "chat_member" and "chat_join_request" updates by a user.
| -rw-r--r-- | telegram-bot-api/Client.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index b9cebed..aec8ce0 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -12963,7 +12963,7 @@ void Client::add_update_chat_member(object_ptr<td_api::updateChatMember> &&updat } auto user_id = static_cast<const td_api::messageSenderUser *>(update->old_chat_member_->member_id_.get())->user_id_; bool is_my = (user_id == my_id_); - auto webhook_queue_id = update->chat_id_ + (static_cast<int64>(is_my ? 5 : 6) << 33); + auto webhook_queue_id = (is_my ? update->chat_id_ : user_id) + (static_cast<int64>(is_my ? 5 : 6) << 33); auto update_type = is_my ? UpdateType::MyChatMember : UpdateType::ChatMember; add_update(update_type, JsonChatMemberUpdated(update.get(), this), left_time, webhook_queue_id); } else { @@ -12977,7 +12977,7 @@ void Client::add_update_chat_join_request(object_ptr<td_api::updateNewChatJoinRe CHECK(update->request_ != nullptr); auto left_time = update->request_->date_ + 86400 - get_unix_time(); if (left_time > 0) { - auto webhook_queue_id = update->chat_id_ + (static_cast<int64>(6) << 33); + auto webhook_queue_id = update->request_->user_id_ + (static_cast<int64>(6) << 33); add_update(UpdateType::ChatJoinRequest, JsonChatJoinRequest(update.get(), this), left_time, webhook_queue_id); } else { LOG(DEBUG) << "Skip updateNewChatJoinRequest with date " << update->request_->date_ << ", because current date is " |
