2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Alpha version 0.10.22: critical bug fixes.

This commit is contained in:
John Preston
2016-12-31 17:34:41 +04:00
parent bc0c355d2d
commit 218f991547
42 changed files with 634 additions and 212 deletions

View File

@@ -447,11 +447,12 @@ void RichDeleteMessageBox::deleteAndClear() {
App::main()->deleteAllFromUser(_channel, _from);
}
if (auto item = App::histItemById(_channel ? peerToChannel(_channel->id) : 0, _msgId)) {
bool wasLast = (item->history()->lastMsg == item);
auto wasLast = (item->history()->lastMsg == item);
item->destroy();
if (_msgId > 0) {
App::main()->deleteMessages(_channel, QVector<MTPint>(1, MTP_int(_msgId)));
auto forEveryone = true;
App::main()->deleteMessages(_channel, QVector<MTPint>(1, MTP_int(_msgId)), forEveryone);
} else if (wasLast) {
App::main()->checkPeerHistory(_channel);
}