Disallow quotes and replies in other chats in secret chats.

This commit is contained in:
levlam 2023-10-29 20:08:59 +03:00
parent c38bb8c51a
commit 9a66b6ec5c
2 changed files with 7 additions and 4 deletions

View File

@ -1245,9 +1245,9 @@ messageReplyToStory story_sender_chat_id:int53 story_id:int32 = MessageReplyTo;
//@class InputMessageReplyTo @description Contains information about the message or the story to be replied
//@description Describes a message to be replied
//@chat_id The identifier of the chat to which the message to be replied belongs; pass 0 if the replied message is in the same chat. A message can be replied in another chat only if message.can_be_forwarded
//@message_id The identifier of the message to be replied in the same chat
//@quote Manually chosen quote from the replied message; pass null if none; 0-getOption("message_reply_quote_length_max") characters.
//@chat_id The identifier of the chat to which the message to be replied belongs; pass 0 if the replied message is in the same chat. Must be always 0 for replies in secret chats. A message can be replied in another chat only if message.can_be_forwarded
//@message_id The identifier of the message to be replied in the same or the specified chat
//@quote Manually chosen quote from the replied message; pass null if none; 0-getOption("message_reply_quote_length_max") characters. Must be always null for replies in secret chats.
//-Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote
inputMessageReplyToMessage chat_id:int53 message_id:int53 quote:formattedText = InputMessageReplyTo;

View File

@ -24529,6 +24529,9 @@ MessageInputReplyTo MessagesManager::get_message_input_reply_to(
if (reply_d == nullptr) {
return {};
}
if (d->dialog_id.get_type() == DialogType::SecretChat) {
return {};
}
}
message_id = get_persistent_message_id(reply_d, message_id);
if (message_id == MessageId(ServerMessageId(1)) && reply_d->dialog_id.get_type() == DialogType::Channel) {
@ -24537,7 +24540,7 @@ MessageInputReplyTo MessagesManager::get_message_input_reply_to(
FormattedText quote;
auto r_quote = get_formatted_text(td_, get_my_dialog_id(), std::move(reply_to_message->quote_),
td_->auth_manager_->is_bot(), true, true, true);
if (r_quote.is_ok()) {
if (r_quote.is_ok() && d->dialog_id.get_type() != DialogType::SecretChat) {
quote = r_quote.move_as_ok();
}
const Message *m = get_message_force(reply_d, message_id, "get_message_input_reply_to 2");