From 1252ef39d1292d181bf64e4b103ae4b91c7fc688 Mon Sep 17 00:00:00 2001 From: reality Date: Thu, 23 Jul 2015 09:58:31 +0000 Subject: [PATCH] add target to record --- modules/report/api.js | 3 ++- modules/report/commands.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/report/api.js b/modules/report/api.js index 557d752..07922e7 100644 --- a/modules/report/api.js +++ b/modules/report/api.js @@ -4,7 +4,7 @@ var uuid = require('node-uuid'), var api = function(dbot) { var api = { - 'notify': function(type, server, user, cName, message, host) { + 'notify': function(type, server, user, cName, message, host, target) { var id = uuid.v4(), tags = []; _.each(message.match(/(#\w+)/g), function(match) { @@ -25,6 +25,7 @@ var api = function(dbot) { 'time': new Date().getTime(), 'message': message, 'host': host, // Host of the target, if passed + 'target': target, 'tags': tags }, function(err, notify) { dbot.api.event.emit('new_notify', [ notify, user.primaryNick ]); diff --git a/modules/report/commands.js b/modules/report/commands.js index c2f964f..8841c24 100644 --- a/modules/report/commands.js +++ b/modules/report/commands.js @@ -258,7 +258,7 @@ var commands = function(dbot) { if(user && _.include(this.config.host_lookup, channelName)) { dbot.api.nickserv.getUserHost(event.server, first, function(host) { message = message.replace(first, first + ' [' + host + ']'); - this.api.notify('notify', event.server, event.rUser, channelName, message, host); + this.api.notify('notify', event.server, event.rUser, channelName, message, host, first); }.bind(this)); } else { this.api.notify('notify', event.server, event.rUser, channelName, message);