From 154753c73205309b38b57af7ded618e83616f3af Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Wed, 3 Apr 2024 17:35:51 +0300 Subject: [PATCH] Removed migrated groups from list of user's own groups. --- Telegram/SourceFiles/window/window_main_menu.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/window/window_main_menu.cpp b/Telegram/SourceFiles/window/window_main_menu.cpp index d5c2d3fce..c49afd1a9 100644 --- a/Telegram/SourceFiles/window/window_main_menu.cpp +++ b/Telegram/SourceFiles/window/window_main_menu.cpp @@ -117,7 +117,9 @@ not_null AddMyChannelsBox( button->setAcceptBoth(true); const auto myChannelsBox = [=](not_null box) { - box->setTitle(tr::lng_notification_channels()); + box->setTitle(chats + ? tr::lng_notification_groups() + : tr::lng_notification_channels()); const auto st = box->lifetime().make_state( st::defaultUserpicButton); @@ -191,10 +193,16 @@ not_null AddMyChannelsBox( const auto &data = controller->session().data(); if (chats) { + auto ids = std::vector(); data.enumerateGroups([&](not_null peer) { + peer = peer->migrateToOrMe(); const auto c = peer->asChannel(); const auto g = peer->asChat(); + if (ranges::contains(ids, peer->id)) { + return; + } if ((c && c->amCreator()) || (g && g->amCreator())) { + ids.push_back(peer->id); add(peer); } });