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:
@@ -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)) {
|
||||
|
Reference in New Issue
Block a user