Fix reply in topic after creation.

This commit is contained in:
John Preston 2023-10-31 13:20:30 +04:00
parent bf20dbe3bc
commit 1cfda38345
3 changed files with 12 additions and 0 deletions

View File

@ -112,6 +112,7 @@ public:
std::shared_ptr<ChatHelpers::Show> show);
void setHistory(const SetHistoryArgs &args);
void updateTopicRootId(MsgId topicRootId);
void init();
void editMessage(FullMsgId id, bool photoEditAllowed = false);
@ -229,6 +230,10 @@ void FieldHeader::setHistory(const SetHistoryArgs &args) {
_topicRootId = args.topicRootId;
}
void FieldHeader::updateTopicRootId(MsgId topicRootId) {
_topicRootId = topicRootId;
}
void FieldHeader::init() {
sizeValue(
) | rpl::start_with_next([=](QSize size) {
@ -855,6 +860,11 @@ Main::Session &ComposeControls::session() const {
return _show->session();
}
void ComposeControls::updateTopicRootId(MsgId topicRootId) {
_topicRootId = topicRootId;
_header->updateTopicRootId(_topicRootId);
}
void ComposeControls::setHistory(SetHistoryArgs &&args) {
_showSlowmodeError = std::move(args.showSlowmodeError);
_sendActionFactory = std::move(args.sendActionFactory);

View File

@ -135,6 +135,7 @@ public:
[[nodiscard]] Main::Session &session() const;
void setHistory(SetHistoryArgs &&args);
void updateTopicRootId(MsgId topicRootId);
void setCurrentDialogsEntryState(Dialogs::EntryState state);
[[nodiscard]] PeerData *sendAsPeer() const;

View File

@ -493,6 +493,7 @@ void RepliesWidget::setupTopicViewer() {
) | rpl::start_with_next([=](const Data::Session::IdChange &change) {
if (_rootId == change.oldId) {
_rootId = change.newId.msg;
_composeControls->updateTopicRootId(_rootId);
_sendAction = owner->sendActionManager().repliesPainter(
_history,
_rootId);