2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 15:45:12 +00:00

Alpha 1.0.10: unpinning converted chat on demand.

If we want to pin a chat and we have reached the limit we now check
for a deactivated (converted to supergroup) chat that is pinned and
is not in the chats list and just silently unpin it if it is found.

Also possible UB fix for a waveform encoding and decoding.
This commit is contained in:
John Preston
2017-02-16 19:47:50 +03:00
parent 8d354382a4
commit 7adfe93a8d
12 changed files with 103 additions and 32 deletions

View File

@@ -643,17 +643,12 @@ void DialogsInner::savePinnedOrder() {
if (newOrder.size() != _pinnedOrder.size()) {
return; // Something has changed in the set of pinned chats.
}
auto peers = QVector<MTPInputPeer>();
peers.reserve(newOrder.size());
for_const (auto history, newOrder) {
if (_pinnedOrder.indexOf(history) < 0) {
return; // Something has changed in the set of pinned chats.
}
peers.push_back(history->peer->input);
}
auto flags = MTPmessages_ReorderPinnedDialogs::Flag::f_force;
MTP::send(MTPmessages_ReorderPinnedDialogs(MTP_flags(qFlags(flags)), MTP_vector(peers)));
App::histories().savePinnedToServer();
}
void DialogsInner::finishReorderPinned() {