Notify settings unknown => draw chats as muted.

Also request common notify settings at the app launch.
This commit is contained in:
John Preston 2018-06-07 22:28:09 +03:00
parent 472a677bca
commit 75a40b83ae
3 changed files with 5 additions and 5 deletions

View file

@ -1741,7 +1741,7 @@ bool Session::notifyIsMuted(
if (const auto until = settings.muteUntil()) {
return resultFromUntil(*until);
}
return false;
return true;
}
bool Session::notifySilentPosts(not_null<const PeerData*> peer) const {

View file

@ -2198,9 +2198,6 @@ void History::applyDialog(const MTPDdialog &data) {
MTP_notifyPeer(data.vpeer),
data.vnotify_settings);
// Request default notification settings for this type of chat.
Auth().data().requestNotifySettings(peer);
if (data.has_draft() && data.vdraft.type() == mtpc_draftMessage) {
Data::applyPeerCloudDraft(peer->id, data.vdraft.c_draftMessage());
}

View file

@ -3700,6 +3700,9 @@ void MainWidget::mtpPing() {
}
void MainWidget::start(const MTPUser *self) {
Auth().api().requestNotifySettings(MTP_inputNotifyUsers());
Auth().api().requestNotifySettings(MTP_inputNotifyChats());
if (!self) {
MTP::send(MTPusers_GetFullUser(MTP_inputUserSelf()), rpcDone(&MainWidget::startWithSelf));
return;
@ -3713,7 +3716,7 @@ void MainWidget::start(const MTPUser *self) {
Local::readSavedPeers();
cSetOtherOnline(0);
if (auto user = App::feedUsers(MTP_vector<MTPUser>(1, *self))) {
if (const auto user = App::feedUsers(MTP_vector<MTPUser>(1, *self))) {
user->loadUserpic();
}