2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Allow multiple items selection in HistoryView.

This commit is contained in:
John Preston
2018-01-26 18:40:11 +03:00
parent 2aa477176c
commit 63c1212ef1
42 changed files with 1402 additions and 537 deletions

View File

@@ -574,20 +574,20 @@ void DeleteMessagesBox::deleteAndClear() {
}
}
if (!_singleItem) {
App::main()->clearSelectedItems();
if (_deleteConfirmedCallback) {
_deleteConfirmedCallback();
}
QMap<PeerData*, QVector<MTPint>> idsByPeer;
for_const (auto fullId, _ids) {
if (auto item = App::histItemById(fullId)) {
for (const auto itemId : _ids) {
if (auto item = App::histItemById(itemId)) {
auto history = item->history();
auto wasOnServer = (item->id > 0);
auto wasLast = (history->lastMsg == item);
item->destroy();
if (wasOnServer) {
idsByPeer[history->peer].push_back(MTP_int(fullId.msg));
idsByPeer[history->peer].push_back(MTP_int(itemId.msg));
} else if (wasLast) {
App::main()->checkPeerHistory(history->peer);
}