Allow 0 as giveaway_message_id in messagePremiumGiveawayCompleted.

This commit is contained in:
levlam 2023-12-11 00:44:47 +03:00
parent 1a50ec474c
commit dce778442c
2 changed files with 3 additions and 5 deletions

View File

@ -2901,7 +2901,7 @@ messagePremiumGiveawayCreated = MessageContent;
messagePremiumGiveaway parameters:premiumGiveawayParameters winner_count:int32 month_count:int32 sticker:sticker = MessageContent;
//@description A Telegram Premium giveaway has been completed for the chat
//@giveaway_message_id Identifier of the message with the giveaway, can be an identifier of a deleted message
//@giveaway_message_id Identifier of the message with the giveaway; can be 0 if the message was deleted
//@winner_count Number of winners in the giveaway
//@unclaimed_prize_count Number of undistributed prizes
messagePremiumGiveawayCompleted giveaway_message_id:int53 winner_count:int32 unclaimed_prize_count:int32 = MessageContent;

View File

@ -6403,10 +6403,8 @@ unique_ptr<MessageContent> get_action_message_content(Td *td, tl_object_ptr<tele
case telegram_api::messageActionGiveawayResults::ID: {
auto action = move_tl_object_as<telegram_api::messageActionGiveawayResults>(action_ptr);
auto reply_to_message_id = replied_message_info.get_same_chat_reply_to_message_id(true);
if (!reply_to_message_id.is_valid()) {
if (message_date >= 1700000000) { // approximate release date
LOG(ERROR) << "Receive giveaway results message with " << reply_to_message_id << " in " << owner_dialog_id;
}
if (!reply_to_message_id.is_valid() && reply_to_message_id != MessageId()) {
LOG(ERROR) << "Receive giveaway results message with " << reply_to_message_id << " in " << owner_dialog_id;
reply_to_message_id = MessageId();
}
return td::make_unique<MessageGiveawayResults>(reply_to_message_id, action->winners_count_,