diff --git a/Telegram/SourceFiles/data/data_session.cpp b/Telegram/SourceFiles/data/data_session.cpp index 5e9f9a20c..2b3b9d653 100644 --- a/Telegram/SourceFiles/data/data_session.cpp +++ b/Telegram/SourceFiles/data/data_session.cpp @@ -3593,6 +3593,19 @@ void Session::updateNotifySettings( } } +void Session::resetNotifySettingsToDefault(not_null 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( not_null peer, crl::time *changesIn) const { diff --git a/Telegram/SourceFiles/data/data_session.h b/Telegram/SourceFiles/data/data_session.h index cb91257bb..e66a83c42 100644 --- a/Telegram/SourceFiles/data/data_session.h +++ b/Telegram/SourceFiles/data/data_session.h @@ -596,6 +596,7 @@ public: not_null peer, std::optional muteForSeconds, std::optional silentPosts = std::nullopt); + void resetNotifySettingsToDefault(not_null peer); bool notifyIsMuted( not_null peer, crl::time *changesIn = nullptr) const; diff --git a/Telegram/SourceFiles/history/view/history_view_contact_status.cpp b/Telegram/SourceFiles/history/view/history_view_contact_status.cpp index 356a91b70..338980b33 100644 --- a/Telegram/SourceFiles/history/view/history_view_contact_status.cpp +++ b/Telegram/SourceFiles/history/view/history_view_contact_status.cpp @@ -367,7 +367,7 @@ void ContactStatus::setupUnarchiveHandler(not_null peer) { _bar.entity()->unarchiveClicks( ) | rpl::start_with_next([=] { Window::ToggleHistoryArchived(peer->owner().history(peer), false); - peer->owner().updateNotifySettings(peer, 0); + peer->owner().resetNotifySettingsToDefault(peer); if (const auto settings = peer->settings()) { using Flag = MTPDpeerSettings::Flag; const auto flags = Flag::f_autoarchived