2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Notifications management moved to AuthSession.

Also implemented Global::WorkMode() as an base::Variable.
This commit is contained in:
John Preston
2017-03-04 22:36:59 +03:00
parent b14ba398e6
commit 81790b2271
80 changed files with 1299 additions and 1152 deletions

View File

@@ -45,6 +45,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "autoupdater.h"
#include "observer_peer.h"
#include "auth_session.h"
#include "window/notifications_manager.h"
namespace {
@@ -95,7 +96,7 @@ DialogsInner::DialogsInner(QWidget *parent, QWidget *main) : SplittedWidget(pare
connect(_cancelSearchInPeer, SIGNAL(clicked()), this, SIGNAL(cancelSearchInPeer()));
_cancelSearchInPeer->hide();
subscribe(FileDownload::ImageLoaded(), [this] { update(); });
subscribe(AuthSession::CurrentDownloaderTaskFinished(), [this] { update(); });
subscribe(Global::RefItemRemoved(), [this](HistoryItem *item) {
itemRemoved(item);
});
@@ -999,7 +1000,7 @@ void DialogsInner::removeDialog(History *history) {
if (_dialogsImportant) {
history->removeFromChatList(Dialogs::Mode::Important, _dialogsImportant.get());
}
if (App::wnd()) App::wnd()->notifyClear(history);
AuthSession::Current().notifications()->clearFromHistory(history);
if (_contacts->contains(history->peer->id)) {
if (!_contactsNoDialogs->contains(history->peer->id)) {
_contactsNoDialogs->addByName(history);
@@ -1889,7 +1890,7 @@ void DialogsInner::loadPeerPhotos() {
auto yFrom = _visibleTop;
auto yTo = _visibleTop + (_visibleBottom - _visibleTop) * (PreloadHeightsCount + 1);
MTP::clearLoaderPriorities();
AuthSession::Current().downloader()->clearPriorities();
if (_state == DefaultState) {
auto otherStart = shownDialogs()->size() * st::dialogsRowHeight;
if (yFrom < otherStart) {