| 2539 | } |
| 2540 | |
| 2541 | void Session::applyPinnedChats( |
| 2542 | Data::Folder *folder, |
| 2543 | const QVector<MTPDialogPeer> &list) { |
| 2544 | for (const auto &peer : list) { |
| 2545 | peer.match([&](const MTPDdialogPeer &data) { |
| 2546 | const auto history = this->history(peerFromMTP(data.vpeer())); |
| 2547 | if (folder) { |
| 2548 | history->setFolder(folder); |
| 2549 | } else { |
| 2550 | history->clearFolder(); |
| 2551 | } |
| 2552 | }, [&](const MTPDdialogPeerFolder &data) { |
| 2553 | if (folder) { |
| 2554 | LOG(("API Error: Nested folders detected.")); |
| 2555 | } |
| 2556 | }); |
| 2557 | } |
| 2558 | chatsList(folder)->pinned()->applyList(this, list); |
| 2559 | notifyPinnedDialogsOrderUpdated(); |
| 2560 | } |
| 2561 | |
| 2562 | void Session::applyPinnedTopics( |
| 2563 | not_null<Data::Forum*> forum, |
no test coverage detected