diff --git a/Telegram/SourceFiles/info/profile/info_profile_members.cpp b/Telegram/SourceFiles/info/profile/info_profile_members.cpp index 39b16a1732..94101dc350 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_members.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_members.cpp @@ -27,6 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "info/profile/info_profile_values.h" #include "info/profile/info_profile_button.h" #include "info/profile/info_profile_members_controllers.h" +#include "info/members/info_members_widget.h" #include "info/info_content_widget.h" #include "info/info_controller.h" #include "info/info_memento.h" @@ -181,9 +182,13 @@ void Members::setupButtons() { using namespace rpl::mappers; _openMembers->addClickHandler([this] { - _controller->window()->showSection(Info::Memento( - _controller->peerId(), - Section::Type::Members)); + auto contentMemento = std::make_unique( + _controller); + contentMemento->setState(saveState()); + auto mementoStack = std::vector>(); + mementoStack.push_back(std::move(contentMemento)); + _controller->window()->showSection( + Info::Memento(std::move(mementoStack))); }); //_searchField->hide(); diff --git a/Telegram/SourceFiles/profile/profile_channel_controllers.cpp b/Telegram/SourceFiles/profile/profile_channel_controllers.cpp index 52ec36fe69..c91ee73d92 100644 --- a/Telegram/SourceFiles/profile/profile_channel_controllers.cpp +++ b/Telegram/SourceFiles/profile/profile_channel_controllers.cpp @@ -527,13 +527,27 @@ bool ParticipantsBoxController::feedMegagroupLastParticipants() { return false; } auto info = megagroup->mgInfo.get(); - if (info->lastParticipantsStatus != MegagroupInfo::LastParticipantsUpToDate) { - _channel->updateFull(); - return false; - } + // + // channelFull and channels_channelParticipants members count is desynced + // so we almost always have LastParticipantsCountOutdated that is set + // inside setMembersCount() and so we almost never use lastParticipants. + // + // => disable this check temporarily. + // + //if (info->lastParticipantsStatus != MegagroupInfo::LastParticipantsUpToDate) { + // _channel->updateFull(); + // return false; + //} if (info->lastParticipants.isEmpty()) { return false; } + if ((info->lastParticipants.size() < Global::ChatSizeMax() / 2) + && (_channel->membersCount() > Global::ChatSizeMax())) { + // If we have really small non-empty count of last participants. + // Request them from the beginning so that we won't do that each + // time we open megagroup profile. + Auth().api().requestLastParticipants(_channel); + } if (info->creator) { _additional.creator = info->creator;