Skip to content

Commit

Permalink
Improve premiumGiftCodeInfo.giveaway_message_id.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Nov 14, 2023
1 parent 718d8df commit d24af04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion td/generate/scheme/td_api.tl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions td/telegram/Premium.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit d24af04

Please sign in to comment.