2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +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

@@ -719,6 +719,17 @@ QList<History*> Histories::getPinnedOrder() const {
return result;
}
void Histories::savePinnedToServer() const {
auto order = getPinnedOrder();
auto peers = QVector<MTPInputPeer>();
peers.reserve(order.size());
for_const (auto history, order) {
peers.push_back(history->peer->input);
}
auto flags = MTPmessages_ReorderPinnedDialogs::Flag::f_force;
MTP::send(MTPmessages_ReorderPinnedDialogs(MTP_flags(qFlags(flags)), MTP_vector(peers)));
}
HistoryItem *History::createItem(const MTPMessage &msg, bool applyServiceAction, bool detachExistingItem) {
auto msgId = MsgId(0);
switch (msg.type()) {