2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +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

@@ -918,8 +918,8 @@ QPoint FeedUserpicButton::countInnerPosition() const {
SilentToggle::SilentToggle(QWidget *parent, not_null<ChannelData*> channel)
: IconButton(parent, st::historySilentToggle)
, _channel(channel)
, _checked(_channel->notifySilentPosts()) {
Expects(!_channel->notifySettingsUnknown());
, _checked(Auth().data().notifySilentPosts(_channel)) {
Expects(!Auth().data().notifySilentPostsUnknown(_channel));
if (_checked) {
refreshIconOverrides();
@@ -962,13 +962,10 @@ void SilentToggle::mouseReleaseEvent(QMouseEvent *e) {
setChecked(!_checked);
IconButton::mouseReleaseEvent(e);
Ui::Tooltip::Show(0, this);
const auto silentState = _checked
? Data::NotifySettings::SilentPostsChange::Silent
: Data::NotifySettings::SilentPostsChange::Notify;
App::main()->updateNotifySettings(
Auth().data().updateNotifySettings(
_channel,
Data::NotifySettings::MuteChange::Ignore,
silentState);
base::none,
_checked);
}
QString SilentToggle::tooltipText() const {