2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-03 16:15:13 +00:00

Skip "contact joined" toast if disabled in Settings.

The chats still appear (they are server-side), but skip the toast.
This commit is contained in:
John Preston
2021-09-23 17:37:29 +04:00
parent cf76933352
commit 2f5bed2899
5 changed files with 21 additions and 8 deletions

View File

@@ -98,25 +98,21 @@ System::SkipState System::skipNotification(
not_null<HistoryItem*> item) const {
const auto history = item->history();
const auto notifyBy = item->specialNotificationPeer();
if (App::quitting() || !history->currentNotification()) {
if (App::quitting()
|| !history->currentNotification()
|| item->skipNotification()) {
return { SkipState::Skip };
} else if (!Core::App().settings().notifyFromAll()
&& &history->session().account() != &Core::App().domain().active()) {
return { SkipState::Skip };
}
const auto scheduled = item->out() && item->isFromScheduled();
if (const auto forwarded = item->Get<HistoryMessageForwarded>()) {
if (forwarded->imported) {
return { SkipState::Skip };
}
}
history->owner().requestNotifySettings(history->peer);
if (notifyBy) {
history->owner().requestNotifySettings(notifyBy);
}
const auto scheduled = item->out() && item->isFromScheduled();
if (history->owner().notifyMuteUnknown(history->peer)) {
return { SkipState::Unknown, item->isSilent() };
} else if (!history->owner().notifyIsMuted(history->peer)) {