mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +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/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<Ui::RpWidget> 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<FloatingIcon>(
|
||||
result,
|
||||
st::infoIconNotifications,
|
||||
|
|
Loading…
Add table
Reference in a new issue