Reset notify settings on unarchive.
This commit is contained in:
parent
5c5414b680
commit
152b49c65c
|
@ -3593,6 +3593,19 @@ void Session::updateNotifySettings(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Session::resetNotifySettingsToDefault(not_null<PeerData*> peer) {
|
||||||
|
const auto empty = MTP_peerNotifySettings(
|
||||||
|
MTP_flags(0),
|
||||||
|
MTPBool(),
|
||||||
|
MTPBool(),
|
||||||
|
MTPint(),
|
||||||
|
MTPstring());
|
||||||
|
if (peer->notifyChange(empty)) {
|
||||||
|
updateNotifySettingsLocal(peer);
|
||||||
|
_session->api().updateNotifySettingsDelayed(peer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool Session::notifyIsMuted(
|
bool Session::notifyIsMuted(
|
||||||
not_null<const PeerData*> peer,
|
not_null<const PeerData*> peer,
|
||||||
crl::time *changesIn) const {
|
crl::time *changesIn) const {
|
||||||
|
|
|
@ -596,6 +596,7 @@ public:
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
std::optional<int> muteForSeconds,
|
std::optional<int> muteForSeconds,
|
||||||
std::optional<bool> silentPosts = std::nullopt);
|
std::optional<bool> silentPosts = std::nullopt);
|
||||||
|
void resetNotifySettingsToDefault(not_null<PeerData*> peer);
|
||||||
bool notifyIsMuted(
|
bool notifyIsMuted(
|
||||||
not_null<const PeerData*> peer,
|
not_null<const PeerData*> peer,
|
||||||
crl::time *changesIn = nullptr) const;
|
crl::time *changesIn = nullptr) const;
|
||||||
|
|
|
@ -367,7 +367,7 @@ void ContactStatus::setupUnarchiveHandler(not_null<PeerData*> peer) {
|
||||||
_bar.entity()->unarchiveClicks(
|
_bar.entity()->unarchiveClicks(
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
Window::ToggleHistoryArchived(peer->owner().history(peer), false);
|
Window::ToggleHistoryArchived(peer->owner().history(peer), false);
|
||||||
peer->owner().updateNotifySettings(peer, 0);
|
peer->owner().resetNotifySettingsToDefault(peer);
|
||||||
if (const auto settings = peer->settings()) {
|
if (const auto settings = peer->settings()) {
|
||||||
using Flag = MTPDpeerSettings::Flag;
|
using Flag = MTPDpeerSettings::Flag;
|
||||||
const auto flags = Flag::f_autoarchived
|
const auto flags = Flag::f_autoarchived
|
||||||
|
|
Loading…
Reference in New Issue