2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Added public api for sound configuration to data notify settings.

This commit is contained in:
23rd
2022-04-05 00:10:15 +03:00
parent 55864edb67
commit a0b88e8f8b
8 changed files with 37 additions and 40 deletions

View File

@@ -230,15 +230,16 @@ void FillMuteMenu(
Args args) {
const auto peer = args.peer;
const auto soundIsNone = peer->owner().notifySettings().soundIsNone(peer);
const auto soundIsNone = peer->owner().notifySettings().sound(peer).none;
menu->addAction(
soundIsNone
? tr::lng_mute_menu_sound_on(tr::now)
: tr::lng_mute_menu_sound_off(tr::now),
[=] {
auto &notifySettings = peer->owner().notifySettings();
const auto soundIsNone = notifySettings.soundIsNone(peer);
notifySettings.updateNotifySettings(peer, {}, {}, !soundIsNone);
auto sound = notifySettings.sound(peer);
sound.none = !sound.none;
notifySettings.updateNotifySettings(peer, {}, {}, sound);
},
soundIsNone ? &st::menuIconSoundOn : &st::menuIconSoundOff);