2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +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

@@ -115,11 +115,14 @@ rpl::producer<QString> LinkValue(
rpl::producer<bool> NotificationsEnabledValue(
not_null<PeerData*> peer) {
return Notify::PeerUpdateValue(
return rpl::merge(
Notify::PeerUpdateValue(
peer,
Notify::PeerUpdate::Flag::NotificationsEnabled
) | rpl::map([] { return rpl::empty_value(); }),
Auth().data().defaultNotifyUpdates(peer)
) | rpl::map([peer] {
return !peer->isMuted();
return !Auth().data().notifyIsMuted(peer);
}) | rpl::distinct_until_changed();
}