Add messageProperties.need_show_statistics.

This commit is contained in:
levlam 2024-07-20 21:55:41 +03:00
parent 80b321fd9a
commit 6d9864a1cf
2 changed files with 5 additions and 3 deletions

View File

@ -3874,14 +3874,15 @@ inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool cop
//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or link preview description using getMessageLink //@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or link preview description using getMessageLink
//@can_get_message_thread True, if information about the message thread is available through getMessageThread and getMessageThreadHistory //@can_get_message_thread True, if information about the message thread is available through getMessageThread and getMessageThreadHistory
//@can_get_read_date True, if read date of the message can be received through getMessageReadDate //@can_get_read_date True, if read date of the message can be received through getMessageReadDate
//@can_get_statistics True, if the message statistics are available through getMessageStatistics and message forwards can be received using getMessagePublicForwards //@can_get_statistics True, if message statistics are available through getMessageStatistics and message forwards can be received using getMessagePublicForwards
//@can_get_viewers True, if chat members already viewed the message can be received through getMessageViewers //@can_get_viewers True, if chat members already viewed the message can be received through getMessageViewers
//@can_recognize_speech True, if speech can be recognized for the message through recognizeSpeech //@can_recognize_speech True, if speech can be recognized for the message through recognizeSpeech
//@can_report_chat True, if the message can be reported using reportChat //@can_report_chat True, if the message can be reported using reportChat
//@can_report_reactions True, if reactions on the message can be reported through reportMessageReactions //@can_report_reactions True, if reactions on the message can be reported through reportMessageReactions
//@can_report_supergroup_spam True, if the message can be reported using reportSupergroupSpam //@can_report_supergroup_spam True, if the message can be reported using reportSupergroupSpam
//@can_set_fact_check True, if fact check for the message can be changed through setMessageFactCheck //@can_set_fact_check True, if fact check for the message can be changed through setMessageFactCheck
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_pinned:Bool can_be_replied:Bool can_be_replied_in_another_chat:Bool can_be_saved:Bool can_be_shared_in_story:Bool can_edit_scheduling_state:Bool can_get_added_reactions:Bool can_get_embedding_code:Bool can_get_link: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_recognize_speech:Bool can_report_chat:Bool can_report_reactions:Bool can_report_supergroup_spam:Bool can_set_fact_check:Bool = MessageProperties; //@need_show_statistics True, if message statistics must be available from context menu of the message
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_pinned:Bool can_be_replied:Bool can_be_replied_in_another_chat:Bool can_be_saved:Bool can_be_shared_in_story:Bool can_edit_scheduling_state:Bool can_get_added_reactions:Bool can_get_embedding_code:Bool can_get_link: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_recognize_speech:Bool can_report_chat:Bool can_report_reactions:Bool can_report_supergroup_spam:Bool can_set_fact_check:Bool need_show_statistics:Bool = MessageProperties;
//@class SearchMessagesFilter @description Represents a filter for message search results //@class SearchMessagesFilter @description Represents a filter for message search results

View File

@ -17374,12 +17374,13 @@ void MessagesManager::get_message_properties(DialogId dialog_id, MessageId messa
td_->chat_manager_->get_channel_status(dialog_id.get_channel_id()).is_administrator() && td_->chat_manager_->get_channel_status(dialog_id.get_channel_id()).is_administrator() &&
can_report_message(m->message_id).is_ok(); can_report_message(m->message_id).is_ok();
auto can_set_fact_check = can_set_message_fact_check(dialog_id, m); auto can_set_fact_check = can_set_message_fact_check(dialog_id, m);
auto need_show_statistics = can_get_statistics && (m->view_count >= 100 || m->forward_count > 0);
promise.set_value(td_api::make_object<td_api::messageProperties>( 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_paid, can_be_pinned, can_delete_for_self, can_delete_for_all_users, can_be_edited, can_be_forwarded, can_be_paid, can_be_pinned,
can_be_replied, can_be_replied_in_another_chat, can_be_saved, can_be_shared_in_story, can_edit_scheduling_state, can_be_replied, can_be_replied_in_another_chat, can_be_saved, can_be_shared_in_story, can_edit_scheduling_state,
can_get_added_reactions, can_get_embedding_code, can_get_link, can_get_media_timestamp_links, can_get_added_reactions, can_get_embedding_code, can_get_link, can_get_media_timestamp_links,
can_get_message_thread, can_get_read_date, can_get_statistics, can_get_viewers, can_recognize_speech, can_get_message_thread, can_get_read_date, can_get_statistics, can_get_viewers, can_recognize_speech,
can_report_chat, can_report_reactions, can_report_supergroup_spam, can_set_fact_check)); can_report_chat, can_report_reactions, can_report_supergroup_spam, can_set_fact_check, need_show_statistics));
} }
bool MessagesManager::is_message_edited_recently(MessageFullId message_full_id, int32 seconds) { bool MessagesManager::is_message_edited_recently(MessageFullId message_full_id, int32 seconds) {