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

Shared media block done in the new profile implementation.

Preparing to call Notify::peerUpdatedSendDelayed() only from event loop.
This commit is contained in:
John Preston
2016-06-02 16:02:55 +03:00
parent 3fc7cc3453
commit 2c4ec3d9f3
35 changed files with 646 additions and 193 deletions

View File

@@ -2336,6 +2336,8 @@ void OverviewWidget::onDeleteSelected() {
}
void OverviewWidget::onDeleteSelectedSure() {
Ui::hideLayer();
SelectedItemSet sel;
_inner.fillSelectedItems(sel);
if (sel.isEmpty()) return;
@@ -2351,7 +2353,6 @@ void OverviewWidget::onDeleteSelectedSure() {
for (SelectedItemSet::const_iterator i = sel.cbegin(), e = sel.cend(); i != e; ++i) {
i.value()->destroy();
}
Ui::hideLayer();
for (QMap<PeerData*, QVector<MTPint> >::const_iterator i = ids.cbegin(), e = ids.cend(); i != e; ++i) {
App::main()->deleteMessages(i.key(), i.value());
@@ -2359,6 +2360,8 @@ void OverviewWidget::onDeleteSelectedSure() {
}
void OverviewWidget::onDeleteContextSure() {
Ui::hideLayer();
HistoryItem *item = App::contextItem();
if (!item || item->type() != HistoryItemMsg) {
return;
@@ -2368,12 +2371,11 @@ void OverviewWidget::onDeleteContextSure() {
History *h = item->history();
bool wasOnServer = (item->id > 0), wasLast = (h->lastMsg == item);
item->destroy();
if (!wasOnServer && wasLast && !h->lastMsg) {
App::main()->checkPeerHistory(h->peer);
}
Ui::hideLayer();
if (wasOnServer) {
App::main()->deleteMessages(h->peer, toDelete);
}