1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:18:12 +00:00

IRCClient: Add NotifyOnMessage/NotifyOnMention config options

Allow IRCClient user to opt out of notifications.
This commit is contained in:
Brendan Coles 2020-04-10 11:29:17 +00:00 committed by Andreas Kling
parent 070a8f2689
commit 63f8cbfb56
4 changed files with 17 additions and 1 deletions

View file

@ -194,7 +194,8 @@ void IRCWindow::post_notification_if_needed(const String& name, const String& me
auto notification = GUI::Notification::construct();
if (type() == Type::Channel) {
if (!m_client.notify_on_mention())
return;
if (!message.contains(m_client.nickname()))
return;
@ -204,6 +205,8 @@ void IRCWindow::post_notification_if_needed(const String& name, const String& me
builder.append(m_name);
notification->set_title(builder.to_string());
} else {
if (!m_client.notify_on_message())
return;
notification->set_title(name);
}