2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +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

@@ -310,10 +310,10 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupMuteToggle() {
result->toggleOn(
NotificationsEnabledValue(peer)
)->addClickHandler([=] {
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);
});
object_ptr<FloatingIcon>(
result,