aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/notifications.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-10-22 01:24:57 +0200
committerfiaxh <git@mx.ax.lt>2017-10-22 18:26:31 +0200
commite49fc134ddf4c1b4e22603b60ea44f59eec496a5 (patch)
tree123bb91b164e7dad994d94d843ea277517666699 /main/src/ui/notifications.vala
parent9ea16b6d8568cb383eb1f469d1dc54bfcad4f188 (diff)
downloaddino-e49fc134ddf4c1b4e22603b60ea44f59eec496a5.tar.gz
dino-e49fc134ddf4c1b4e22603b60ea44f59eec496a5.zip
Only match full words as mentions for notifications
fixes #185
Diffstat (limited to 'main/src/ui/notifications.vala')
-rw-r--r--main/src/ui/notifications.vala4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/src/ui/notifications.vala b/main/src/ui/notifications.vala
index 313d0854..b3a373be 100644
--- a/main/src/ui/notifications.vala
+++ b/main/src/ui/notifications.vala
@@ -113,7 +113,9 @@ public class Notifications : Object {
Conversation.NotifySetting notify = conversation.get_notification_setting(stream_interactor);
if (notify == Conversation.NotifySetting.OFF) return false;
Jid? nick = stream_interactor.get_module(MucManager.IDENTITY).get_own_jid(conversation.counterpart, conversation.account);
- if (notify == Conversation.NotifySetting.HIGHLIGHT && nick != null && !message.body.contains(nick.resourcepart)) return false;
+ if (notify == Conversation.NotifySetting.HIGHLIGHT && nick != null) {
+ return Regex.match_simple("""\b""" + Regex.escape_string(nick.resourcepart) + """\b""", message.body, RegexCompileFlags.CASELESS);
+ }
return true;
}