colours for ~notify [#560]

This commit is contained in:
reality 2013-08-21 18:12:43 +00:00
parent 509911aae0
commit 493f29ff57
2 changed files with 26 additions and 6 deletions

View File

@ -7,5 +7,14 @@
"webAccess": "regular",
"pageAccess": {
"/report/:server/:channel": "power_users"
},
"colours": {
"wherever": {
"channels": {
"#test": "\u00032"
},
"nicks": "",
"type": ""
}
}
}

View File

@ -117,12 +117,6 @@ var report = function(dbot) {
message = event.input[2];
if(_.has(event.allChannels, channelName)) {
this.api.notify(event.server, channelName, dbot.t('notify', {
'channel': channelName,
'notifier': event.user,
'message': message
}));
var id = uuid.v4();
this.db.save('notifies', id, {
'id': id,
@ -133,6 +127,23 @@ var report = function(dbot) {
'message': message
}, function() {});
if(_.has(this.config.colours, event.server)) {
var colours = this.config[event.server];
notifier = colours['nicks'] + event.user + '\u000f';
type = colours['type'] + 'notify' + '\u000f';
if(_.has(colours['channels'], channelName)) {
channelName = colours['channels'][channelName] +
channelName + "\u000f";
}
}
this.api.notify(event.server, channelName, dbot.t('notify', {
'channel': channelName,
'notifier': notifier,
'message': message
}));
event.reply(dbot.t('notified', {
'user': event.user,
'channel': channelName