From 840ed71188911ab2ab9f2b16f0ca4acff72c5400 Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 14 Mar 2015 09:24:51 +0000 Subject: [PATCH] store host in notify --- 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 e4459c2..cba5779 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) { + 'notify': function(type, server, user, cName, message, host) { var id = uuid.v4(), tags = []; _.each(message.match(/(#\w+)/g), function(match) { @@ -24,6 +24,7 @@ var api = function(dbot) { 'user': user.id, 'time': new Date().getTime(), 'message': message, + 'host': host, // Host of the target, if passed '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 3aab4dd..c4ba26e 100644 --- a/modules/report/commands.js +++ b/modules/report/commands.js @@ -226,7 +226,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); + this.api.notify('notify', event.server, event.rUser, channelName, message, host); }.bind(this)); } else { this.api.notify('notify', event.server, event.rUser, channelName, message);