From 011b573a8e54665cbbecfc882b40294ea13e2e7d Mon Sep 17 00:00:00 2001 From: luckydonald Date: Mon, 18 Jan 2021 00:12:48 +0100 Subject: [PATCH] Fix leaking the user's phone in the id field of the stats. Improves tdlight-team/tdlight-telegram-bot-api#48 a bit. --- telegram-bot-api/Client.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 99b5ac85c..f29432d7a 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -3670,7 +3670,11 @@ std::size_t Client::get_pending_update_count() const { ServerBotInfo Client::get_bot_info() const { ServerBotInfo res; - res.id_ = bot_token_id_; + if (is_user_) { + res.id_ = td::to_string(my_id_); + } else { + res.id_ = bot_token_id_; + } res.token_ = bot_token_; auto user_info = get_user_info(my_id_); if (user_info != nullptr) {