From 82d83e0cb6399ef681ebcc7c586e751065f80f09 Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Sun, 27 Apr 2014 11:25:03 +0200 Subject: [PATCH] Better highlight detection --- lib/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/server.js b/lib/server.js index a095809..03d0753 100644 --- a/lib/server.js +++ b/lib/server.js @@ -355,8 +355,8 @@ function event(e, data) { var type = ""; var text = data.message; var network = this; - text.split(" ").forEach(function(w) { - if (w == network.client.me) type = "highlight"; + text.split(/ |'|:/).forEach(function(w) { + if (w.indexOf(network.client.me) == 0) type = "highlight"; }); var msg = new Msg({ type: type,