MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / setupMigrationViewer

Method setupMigrationViewer

Telegram/SourceFiles/data/data_session.cpp:1669–1691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1667}
1668
1669void Session::setupMigrationViewer() {
1670 session().changes().peerUpdates(
1671 PeerUpdate::Flag::Migration
1672 ) | rpl::map([](const PeerUpdate &update) {
1673 return update.peer->asChat();
1674 }) | rpl::filter([=](ChatData *chat) {
1675 return (chat != nullptr);
1676 }) | rpl::on_next([=](not_null<ChatData*> chat) {
1677 const auto channel = chat->migrateTo();
1678 if (!channel) {
1679 return;
1680 }
1681
1682 chat->clearGroupCall();
1683 if (const auto from = historyLoaded(chat)) {
1684 if (const auto to = historyLoaded(channel)) {
1685 if (to->inChatList() && from->inChatList()) {
1686 removeChatListEntry(from);
1687 }
1688 }
1689 }
1690 }, _lifetime);
1691}
1692
1693void Session::setupChannelLeavingViewer() {
1694 session().changes().peerUpdates(

Callers

nothing calls this directly

Calls 6

peerUpdatesMethod · 0.80
asChatMethod · 0.80
migrateToMethod · 0.80
inChatListMethod · 0.80
changesMethod · 0.45
clearGroupCallMethod · 0.45

Tested by

no test coverage detected