From 388e9cec09cb863d4064af39d3f696aa3ffa9a7a Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 20 Sep 2025 17:15:26 +0300 Subject: [PATCH] Respected admin rights in subsections slider for reordering. --- .../view/history_view_subsection_tabs.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/view/history_view_subsection_tabs.cpp b/Telegram/SourceFiles/history/view/history_view_subsection_tabs.cpp index 7ca858df2d..0c7fc83c52 100644 --- a/Telegram/SourceFiles/history/view/history_view_subsection_tabs.cpp +++ b/Telegram/SourceFiles/history/view/history_view_subsection_tabs.cpp @@ -341,6 +341,19 @@ void SubsectionTabs::startScrollChecking( refreshAroundMiddle(scroll, slider); } }, scroll->lifetime()); + + session().changes().peerUpdates( + Data::PeerUpdate::Flag::Rights + ) | rpl::filter([=](const Data::PeerUpdate &update) { + return (update.peer == _history->peer); + }) | rpl::start_with_next([=] { + if (_reorder) { + _reorder->cancel(); + if (_history->peer->canManageTopics()) { + _reorder->start(); + } + } + }, _lifetime); } void SubsectionTabs::startFillingSlider( @@ -517,7 +530,9 @@ void SubsectionTabs::startFillingSlider( Assert(slider->sectionsCount() == _slice.size()); _reorder->cancel(); - _reorder->start(); + if (_history->peer->canManageTopics()) { + _reorder->start(); + } if (ignoreActiveScroll) { Assert(scrollSavingIndex < slider->sectionsCount());