From dfde53b8ace962344aa4d0334c8777e000553923 Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 24 Aug 2013 20:27:44 +0000 Subject: [PATCH] fix the host matching thing and make the regex sexier --- modules/report/report.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/report/report.js b/modules/report/report.js index bea1f39..c13f5b6 100644 --- a/modules/report/report.js +++ b/modules/report/report.js @@ -157,12 +157,11 @@ var report = function(dbot) { cChan + "\u000f"; } - _.each(message.match(/@([\d\w\s*|-]+?)( |$|,|\.)/g), function(user) { - user = user.replace(/@([\d\w\s*|-]+?)( |$|,|\.)/, "$1"); - notifier += '[' + colours['nicks'] + user + '\u000f]'; + _.each(message.match(/ @([\d\w*|-]+)/g), function(user) { + user = user.substr(1); + message = message.replace(user, colours['nicks'] + user + "\u000f"); + notifier += '[' + colours['nicks'] + user.substr(1) + '\u000f]'; }); - message = message.replace(/@([\d\w\s*|-]+?)( |$|,|\.)/g, colours['nicks'] + - "@$1\u000f$2"); } this.api.notify(event.server, channelName, dbot.t('notify', {