Improve premiumGiftCodeInfo.giveaway_message_id.

This commit is contained in:
levlam 2023-11-14 14:45:38 +03:00
parent 718d8dfdef
commit d24af0436f
2 changed files with 5 additions and 1 deletions

View File

@ -699,7 +699,7 @@ premiumGiftCodePaymentOptions options:vector<premiumGiftCodePaymentOption> = Pre
//@creator_id Identifier of a chat or a user that created the gift code
//@creation_date Point in time (Unix timestamp) when the code was created
//@is_from_giveaway True, if the gift code was created for a giveaway
//@giveaway_message_id Identifier of the corresponding giveaway message; can be 0 or an identifier of a deleted message
//@giveaway_message_id Identifier of the corresponding giveaway message in the creator_id chat; can be 0 or an identifier of a deleted message
//@month_count Number of month the Telegram Premium subscription will be active after code activation
//@user_id Identifier of a user for which the code was created; 0 if none
//@use_date Point in time (Unix timestamp) when the code was activated; 0 if none

View File

@ -341,6 +341,10 @@ class CheckGiftCodeQuery final : public Td::ResultHandler {
LOG(ERROR) << "Receive " << to_string(result);
message_id = MessageId();
}
if (message_id != MessageId() && creator_dialog_id.get_type() != DialogType::Channel) {
LOG(ERROR) << "Receive " << to_string(result);
message_id = MessageId();
}
promise_.set_value(td_api::make_object<td_api::premiumGiftCodeInfo>(
get_message_sender_object(td_, creator_dialog_id, "premiumGiftCodeInfo"), result->date_, result->via_giveaway_,
message_id.get(), result->months_, td_->contacts_manager_->get_user_id_object(user_id, "premiumGiftCodeInfo"),