mirror of
https://github.com/reality/dbot.git
synced 2024-11-30 16:09:27 +01:00
add target to record
This commit is contained in:
parent
bf54039724
commit
1252ef39d1
@ -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 ]);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user