mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-13 04:37:11 +02:00
Fix saved messages sublists pinning updates.
This commit is contained in:
parent
87c1329490
commit
9f738cded2
3 changed files with 27 additions and 1 deletions
|
@ -277,7 +277,7 @@ void SavedMessages::apply(const MTPDupdatePinnedSavedDialogs &update) {
|
|||
if (!ranges::none_of(order, notLoaded)) {
|
||||
loadPinned();
|
||||
} else {
|
||||
_chatsList.pinned()->applyList(_owner, order);
|
||||
_chatsList.pinned()->applyList(this, order);
|
||||
_owner->notifyPinnedDialogsOrderUpdated();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
*/
|
||||
#include "dialogs/dialogs_pinned_list.h"
|
||||
|
||||
#include "data/data_saved_messages.h"
|
||||
#include "dialogs/dialogs_key.h"
|
||||
#include "dialogs/dialogs_entry.h"
|
||||
#include "history/history.h"
|
||||
|
@ -86,6 +87,8 @@ void PinnedList::clear() {
|
|||
void PinnedList::applyList(
|
||||
not_null<Data::Session*> owner,
|
||||
const QVector<MTPDialogPeer> &list) {
|
||||
Expects(this != owner->savedMessages().chatsList()->pinned());
|
||||
|
||||
clear();
|
||||
for (const auto &peer : list) {
|
||||
peer.match([&](const MTPDdialogPeer &data) {
|
||||
|
@ -98,9 +101,28 @@ void PinnedList::applyList(
|
|||
}
|
||||
}
|
||||
|
||||
void PinnedList::applyList(
|
||||
not_null<Data::SavedMessages*> sublistsOwner,
|
||||
const QVector<MTPDialogPeer> &list) {
|
||||
Expects(this == sublistsOwner->chatsList()->pinned());
|
||||
|
||||
clear();
|
||||
for (const auto &peer : list) {
|
||||
peer.match([&](const MTPDdialogPeer &data) {
|
||||
if (const auto peerId = peerFromMTP(data.vpeer())) {
|
||||
const auto peer = sublistsOwner->owner().peer(peerId);
|
||||
addPinned(sublistsOwner->sublist(peer));
|
||||
}
|
||||
}, [](const MTPDdialogPeerFolder &data) {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void PinnedList::applyList(
|
||||
not_null<Data::Forum*> forum,
|
||||
const QVector<MTPint> &list) {
|
||||
Expects(this == forum->topicsList()->pinned());
|
||||
|
||||
clear();
|
||||
for (const auto &topicId : list) {
|
||||
addPinned(forum->topicFor(topicId.v));
|
||||
|
|
|
@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
class History;
|
||||
|
||||
namespace Data {
|
||||
class SavedMessages;
|
||||
class Session;
|
||||
class Forum;
|
||||
} // namespace Data
|
||||
|
@ -36,6 +37,9 @@ public:
|
|||
void applyList(
|
||||
not_null<Data::Session*> owner,
|
||||
const QVector<MTPDialogPeer> &list);
|
||||
void applyList(
|
||||
not_null<Data::SavedMessages*> sublistsOwner,
|
||||
const QVector<MTPDialogPeer> &list);
|
||||
void applyList(
|
||||
not_null<Data::Forum*> forum,
|
||||
const QVector<MTPint> &list);
|
||||
|
|
Loading…
Add table
Reference in a new issue