From fa1e7a1eab44780eead453e20a8a9276fef67eda Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 14 Jul 2023 14:04:16 +0300 Subject: [PATCH] Fix get_message_content_min_user_ids. --- td/telegram/MessageContent.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index b1c25a314..931175c3c 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -3317,14 +3317,19 @@ vector get_message_content_min_user_ids(const Td *td, const MessageConte break; case MessageContentType::Contact: { const auto *content = static_cast(message_content); - return {content->contact.get_user_id()}; + auto user_id = content->contact.get_user_id(); + if (user_id.is_valid()) { + return {user_id}; + } + break; } case MessageContentType::Document: break; case MessageContentType::Game: { - // not supported + // not supported server-side // const auto *content = static_cast(message_content); // return {content->game.get_bot_user_id())}; + break; } case MessageContentType::Invoice: break; @@ -3437,8 +3442,9 @@ vector get_message_content_min_user_ids(const Td *td, const MessageConte break; case MessageContentType::Story: { const auto *content = static_cast(message_content); - if (content->story_full_id.get_dialog_id().get_type() == DialogType::User) { - return {content->story_full_id.get_dialog_id().get_user_id()}; + auto dialog_id = content->story_full_id.get_dialog_id(); + if (dialog_id.get_type() == DialogType::User) { + return {dialog_id.get_user_id()}; } break; }