mirror of
https://github.com/reality/dbot.git
synced 2024-11-30 16:09:27 +01:00
store host in notify
This commit is contained in:
parent
d83a2cab74
commit
840ed71188
@ -4,7 +4,7 @@ var uuid = require('node-uuid'),
|
|||||||
|
|
||||||
var api = function(dbot) {
|
var api = function(dbot) {
|
||||||
var api = {
|
var api = {
|
||||||
'notify': function(type, server, user, cName, message) {
|
'notify': function(type, server, user, cName, message, host) {
|
||||||
var id = uuid.v4(),
|
var id = uuid.v4(),
|
||||||
tags = [];
|
tags = [];
|
||||||
_.each(message.match(/(#\w+)/g), function(match) {
|
_.each(message.match(/(#\w+)/g), function(match) {
|
||||||
@ -24,6 +24,7 @@ var api = function(dbot) {
|
|||||||
'user': user.id,
|
'user': user.id,
|
||||||
'time': new Date().getTime(),
|
'time': new Date().getTime(),
|
||||||
'message': message,
|
'message': message,
|
||||||
|
'host': host, // Host of the target, if passed
|
||||||
'tags': tags
|
'tags': tags
|
||||||
}, function(err, notify) {
|
}, function(err, notify) {
|
||||||
dbot.api.event.emit('new_notify', [ notify, user.primaryNick ]);
|
dbot.api.event.emit('new_notify', [ notify, user.primaryNick ]);
|
||||||
|
@ -226,7 +226,7 @@ var commands = function(dbot) {
|
|||||||
if(user && _.include(this.config.host_lookup, channelName)) {
|
if(user && _.include(this.config.host_lookup, channelName)) {
|
||||||
dbot.api.nickserv.getUserHost(event.server, first, function(host) {
|
dbot.api.nickserv.getUserHost(event.server, first, function(host) {
|
||||||
message = message.replace(first, first + ' [' + 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));
|
}.bind(this));
|
||||||
} else {
|
} else {
|
||||||
this.api.notify('notify', event.server, event.rUser, channelName, message);
|
this.api.notify('notify', event.server, event.rUser, channelName, message);
|
||||||
|
Loading…
Reference in New Issue
Block a user