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

New notifications API, defaults for users/chats.

This commit is contained in:
John Preston
2018-04-09 21:48:29 +04:00
parent 4b4e22d59d
commit 734c410879
32 changed files with 724 additions and 541 deletions

View File

@@ -26,6 +26,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/window_peer_menu.h"
#include "boxes/peer_list_box.h"
#include "auth_session.h"
#include "data/data_session.h"
#include "mainwidget.h"
#include "lang/lang_keys.h"
#include "styles/style_info.h"
@@ -449,10 +450,10 @@ void WrapWidget::addProfileNotificationsButton() {
? st::infoLayerTopBarNotifications
: st::infoTopBarNotifications)));
notifications->addClickHandler([peer] {
const auto muteState = peer->isMuted()
? Data::NotifySettings::MuteChange::Unmute
: Data::NotifySettings::MuteChange::Mute;
App::main()->updateNotifySettings(peer, muteState);
const auto muteForSeconds = Auth().data().notifyIsMuted(peer)
? 0
: Data::NotifySettings::kDefaultMutePeriod;
Auth().data().updateNotifySettings(peer, muteForSeconds);
});
Profile::NotificationsEnabledValue(
peer