Support replying of supergroup stories in the supergroup.

This commit is contained in:
levlam 2024-02-11 02:57:08 +03:00
parent e62f612c36
commit 978cd5ef34
2 changed files with 6 additions and 7 deletions

View File

@ -13141,8 +13141,7 @@ std::pair<DialogId, unique_ptr<MessagesManager::Message>> MessagesManager::creat
bool is_topic_message = message_info.reply_header.is_topic_message_;
auto reply_to_story_full_id = message_info.reply_header.story_full_id_;
if (reply_to_story_full_id != StoryFullId() &&
(dialog_type != DialogType::User || (reply_to_story_full_id.get_dialog_id() != my_dialog_id &&
reply_to_story_full_id.get_dialog_id() != dialog_id))) {
(reply_to_story_full_id.get_dialog_id() != my_dialog_id && reply_to_story_full_id.get_dialog_id() != dialog_id)) {
LOG(ERROR) << "Receive reply to " << reply_to_story_full_id << " in " << dialog_id;
reply_to_story_full_id = {};
}
@ -23003,7 +23002,7 @@ MessageInputReplyTo MessagesManager::get_message_input_reply_to(
auto reply_to_story = td_api::move_object_as<td_api::inputMessageReplyToStory>(reply_to);
auto story_id = StoryId(reply_to_story->story_id_);
auto sender_dialog_id = DialogId(reply_to_story->story_sender_chat_id_);
if (d->dialog_id != sender_dialog_id || sender_dialog_id.get_type() != DialogType::User) {
if (d->dialog_id != sender_dialog_id || td_->dialog_manager_->is_broadcast_channel(sender_dialog_id)) {
LOG(INFO) << "Ignore reply to story from " << sender_dialog_id << " in a wrong " << d->dialog_id;
return {};
}

View File

@ -933,8 +933,8 @@ class CliClient final : public Actor {
return td_api::make_object<td_api::inputMessageReplyToMessage>(reply_chat_id_, reply_message_id_,
std::move(quote));
}
if (reply_user_id_ != 0 || reply_story_id_ != 0) {
return td_api::make_object<td_api::inputMessageReplyToStory>(reply_user_id_, reply_story_id_);
if (reply_story_chat_id_ != 0 || reply_story_id_ != 0) {
return td_api::make_object<td_api::inputMessageReplyToStory>(reply_story_chat_id_, reply_story_id_);
}
return nullptr;
}
@ -4673,7 +4673,7 @@ class CliClient final : public Actor {
} else if (op == "smrqp") {
reply_quote_position_ = to_integer<int32>(args);
} else if (op == "smrs") {
get_args(args, reply_user_id_, reply_story_id_);
get_args(args, reply_story_chat_id_, reply_story_id_);
} else if (op == "slpo") {
get_args(args, link_preview_is_disabled_, link_preview_url_, link_preview_force_small_media_,
link_preview_force_large_media_, link_preview_show_above_text_);
@ -6541,7 +6541,7 @@ class CliClient final : public Actor {
MessageId reply_message_id_;
string reply_quote_;
int32 reply_quote_position_ = 0;
UserId reply_user_id_;
ChatId reply_story_chat_id_;
StoryId reply_story_id_;
ChatId reposted_story_chat_id_;
StoryId reposted_story_id_;