| 1667 | } |
| 1668 | |
| 1669 | void 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 | |
| 1693 | void Session::setupChannelLeavingViewer() { |
| 1694 | session().changes().peerUpdates( |
nothing calls this directly
no test coverage detected