From 4d0b0bbf6682a1349ade8d12399df5bdfe4e90ae Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sun, 27 Mar 2022 16:18:02 +0300 Subject: [PATCH] Added mute menu to button for notifications in profile. --- .../info/profile/info_profile_actions.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index 17be7979c3..a7cbc234b4 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -34,6 +34,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "boxes/peers/add_bot_to_chat_box.h" #include "boxes/peers/edit_contact_box.h" #include "lang/lang_keys.h" +#include "menu/menu_mute.h" #include "info/info_controller.h" #include "info/info_memento.h" #include "info/profile/info_profile_icon.h" @@ -374,14 +375,11 @@ object_ptr DetailsFiller::setupMuteToggle() { _wrap, tr::lng_profile_enable_notifications(), st::infoNotificationsButton); - result->toggleOn( - NotificationsEnabledValue(peer) - )->addClickHandler([=] { - const auto muteForSeconds = peer->owner().notifyIsMuted(peer) - ? 0 - : Data::NotifySettings::kDefaultMutePeriod; - peer->owner().updateNotifySettings(peer, muteForSeconds); - }); + result->toggleOn(NotificationsEnabledValue(peer), true); + MuteMenu::SetupMuteMenu( + result.data(), + result->clicks() | rpl::to_empty, + peer); object_ptr( result, st::infoIconNotifications,