mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-25 04:38:23 +00:00
Follow group->supergroup migration in info.
This commit is contained in:
parent
11a3308cf5
commit
230c83d218
Telegram/SourceFiles/info
@ -25,6 +25,8 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
#include "info/info_content_widget.h"
|
||||
#include "info/info_memento.h"
|
||||
#include "info/media/info_media_widget.h"
|
||||
#include "observer_peer.h"
|
||||
#include "window/window_controller.h"
|
||||
|
||||
namespace Info {
|
||||
namespace {
|
||||
@ -52,6 +54,29 @@ Controller::Controller(
|
||||
, _window(window)
|
||||
, _section(memento->section()) {
|
||||
updateSearchControllers(memento);
|
||||
setupMigrationViewer();
|
||||
}
|
||||
|
||||
void Controller::setupMigrationViewer() {
|
||||
if (!_peer->isChat() && (!_peer->isChannel() || _migrated != nullptr)) {
|
||||
return;
|
||||
}
|
||||
Notify::PeerUpdateValue(_peer, Notify::PeerUpdate::Flag::MigrationChanged)
|
||||
| rpl::start_with_next([this] {
|
||||
if (_peer->migrateTo() || (_peer->migrateFrom() != _migrated)) {
|
||||
auto windowController = window();
|
||||
auto peerId = _peer->id;
|
||||
auto section = _section;
|
||||
InvokeQueued(_widget, [=] {
|
||||
windowController->showSection(
|
||||
Memento(peerId, section),
|
||||
Window::SectionShow(
|
||||
Window::SectionShow::Way::Backward,
|
||||
anim::type::instant,
|
||||
anim::activation::background));
|
||||
});
|
||||
}
|
||||
}, lifetime());
|
||||
}
|
||||
|
||||
Wrap Controller::wrap() const {
|
||||
|
@ -133,6 +133,7 @@ private:
|
||||
|
||||
void updateSearchControllers(not_null<ContentMemento*> memento);
|
||||
SearchQuery produceSearchQuery(const QString &query) const;
|
||||
void setupMigrationViewer();
|
||||
|
||||
not_null<WrapWidget*> _widget;
|
||||
not_null<PeerData*> _peer;
|
||||
|
Loading…
Reference in New Issue
Block a user