mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-08 08:04:08 +02:00
Added mute menu to button for notifications in profile.
This commit is contained in:
parent
3f6c693c3f
commit
4d0b0bbf66
1 changed files with 6 additions and 8 deletions
|
@ -34,6 +34,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "boxes/peers/add_bot_to_chat_box.h"
|
#include "boxes/peers/add_bot_to_chat_box.h"
|
||||||
#include "boxes/peers/edit_contact_box.h"
|
#include "boxes/peers/edit_contact_box.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
|
#include "menu/menu_mute.h"
|
||||||
#include "info/info_controller.h"
|
#include "info/info_controller.h"
|
||||||
#include "info/info_memento.h"
|
#include "info/info_memento.h"
|
||||||
#include "info/profile/info_profile_icon.h"
|
#include "info/profile/info_profile_icon.h"
|
||||||
|
@ -374,14 +375,11 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupMuteToggle() {
|
||||||
_wrap,
|
_wrap,
|
||||||
tr::lng_profile_enable_notifications(),
|
tr::lng_profile_enable_notifications(),
|
||||||
st::infoNotificationsButton);
|
st::infoNotificationsButton);
|
||||||
result->toggleOn(
|
result->toggleOn(NotificationsEnabledValue(peer), true);
|
||||||
NotificationsEnabledValue(peer)
|
MuteMenu::SetupMuteMenu(
|
||||||
)->addClickHandler([=] {
|
result.data(),
|
||||||
const auto muteForSeconds = peer->owner().notifyIsMuted(peer)
|
result->clicks() | rpl::to_empty,
|
||||||
? 0
|
peer);
|
||||||
: Data::NotifySettings::kDefaultMutePeriod;
|
|
||||||
peer->owner().updateNotifySettings(peer, muteForSeconds);
|
|
||||||
});
|
|
||||||
object_ptr<FloatingIcon>(
|
object_ptr<FloatingIcon>(
|
||||||
result,
|
result,
|
||||||
st::infoIconNotifications,
|
st::infoIconNotifications,
|
||||||
|
|
Loading…
Add table
Reference in a new issue