diff --git a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp index 6fd788fd0..43f505b6b 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp @@ -112,6 +112,7 @@ public: std::shared_ptr 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); diff --git a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.h b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.h index 18a76132e..be07fd1b5 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.h +++ b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.h @@ -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; diff --git a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp index ead3dd294..8789099ea 100644 --- a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp @@ -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);