Add messageProperties.can_be_paid.

This commit is contained in:
levlam 2024-07-08 15:38:20 +03:00
parent ba48f1b885
commit 2782bf1095
2 changed files with 7 additions and 4 deletions

View File

@ -3833,6 +3833,7 @@ inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool cop
//@can_be_edited True, if the message can be edited using the methods editMessageText, editMessageMedia, editMessageCaption, or editMessageReplyMarkup.
//-For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message
//@can_be_forwarded True, if the message can be forwarded using inputMessageForwarded or forwardMessages
//@can_be_paid True, if the message can be paid using inputInvoiceMessage
//@can_be_replied True, if the message can be replied in the same chat and forum topic using inputMessageReplyToMessage
//@can_be_replied_in_another_chat True, if the message can be replied in another chat or forum topic using inputMessageReplyToExternalMessage
//@can_be_reported True, if the message can be reported using reportSupergroupSpam or reportChat
@ -3844,7 +3845,7 @@ inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool cop
//@can_get_statistics True, if the message statistics are available through getMessageStatistics
//@can_get_viewers True, if chat members already viewed the message can be received through getMessageViewers
//@can_report_reactions True, if reactions on the message can be reported through reportMessageReactions
messageProperties can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied:Bool can_be_replied_in_another_chat:Bool can_be_reported:Bool can_be_saved:Bool can_get_added_reactions:Bool can_get_media_timestamp_links:Bool can_get_message_thread:Bool can_get_read_date:Bool can_get_statistics:Bool can_get_viewers:Bool can_report_reactions:Bool = MessageProperties;
messageProperties can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_paid:Bool can_be_replied:Bool can_be_replied_in_another_chat:Bool can_be_reported:Bool can_be_saved:Bool can_get_added_reactions:Bool can_get_media_timestamp_links:Bool can_get_message_thread:Bool can_get_read_date:Bool can_get_statistics:Bool can_get_viewers:Bool can_report_reactions:Bool = MessageProperties;
//@class SearchMessagesFilter @description Represents a filter for message search results

View File

@ -17300,8 +17300,9 @@ void MessagesManager::get_message_properties(DialogId dialog_id, MessageId messa
const Message *m = get_message_force(d, message_id, "get_message_properties");
if (m == nullptr) {
if (message_id.is_valid_sponsored()) {
return promise.set_value(td_api::make_object<td_api::messageProperties>(
false, false, false, false, false, false, false, false, false, false, false, false, false, false, false));
return promise.set_value(td_api::make_object<td_api::messageProperties>(false, false, false, false, false, false,
false, false, false, false, false, false,
false, false, false, false));
}
return promise.set_error(Status::Error(400, "Message not found"));
}
@ -17337,6 +17338,7 @@ void MessagesManager::get_message_properties(DialogId dialog_id, MessageId messa
auto can_be_saved = can_save_message(dialog_id, m);
auto can_be_edited = can_edit_message(dialog_id, m, false, is_bot);
auto can_be_forwarded = can_be_saved && can_forward_message(dialog_id, m);
auto can_be_paid = get_invoice_message_id({dialog_id, m->message_id}).is_ok();
auto can_be_replied =
message_id.is_valid() && !(message_id == MessageId(ServerMessageId(1)) && dialog_type == DialogType::Channel) &&
m->message_id.is_yet_unsent() && (!m->message_id.is_local() || dialog_type == DialogType::SecretChat) &&
@ -17351,7 +17353,7 @@ void MessagesManager::get_message_properties(DialogId dialog_id, MessageId messa
auto can_get_media_timestamp_links = can_get_media_timestamp_link(dialog_id, m).is_ok();
auto can_report_reactions = can_report_message_reactions(dialog_id, m);
promise.set_value(td_api::make_object<td_api::messageProperties>(
can_delete_for_self, can_delete_for_all_users, can_be_edited, can_be_forwarded, can_be_replied,
can_delete_for_self, can_delete_for_all_users, can_be_edited, can_be_forwarded, can_be_paid, can_be_replied,
can_be_replied_in_another_chat, can_be_reported, can_be_saved, can_get_added_reactions,
can_get_media_timestamp_links, can_get_message_thread, can_get_read_date, can_get_statistics, can_get_viewers,
can_report_reactions));