forked from GitHub/dbot
fix reports and warning
This commit is contained in:
parent
34acae025b
commit
b18a61ebd1
@ -41,9 +41,6 @@ var api = function(dbot) {
|
|||||||
this.db.read('nunsubs', channel.id, function(err, nunsubs) {
|
this.db.read('nunsubs', channel.id, function(err, nunsubs) {
|
||||||
async.eachSeries(ops, function(nick, next) {
|
async.eachSeries(ops, function(nick, next) {
|
||||||
dbot.api.users.resolveUser(server, nick, function(user) {
|
dbot.api.users.resolveUser(server, nick, function(user) {
|
||||||
if(!_.include(user.mobile, user.currentNick)) {
|
|
||||||
perOps = _.without(perOps, user.id);
|
|
||||||
}
|
|
||||||
if(nunsubs && _.include(nunsubs.users, user.id)) {
|
if(nunsubs && _.include(nunsubs.users, user.id)) {
|
||||||
ops = _.without(ops, user.currentNick);
|
ops = _.without(ops, user.currentNick);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ var warning = function(dbot) {
|
|||||||
'warn': function(server, warner, user, reason, channel, callback) {
|
'warn': function(server, warner, user, reason, channel, callback) {
|
||||||
var adminChannel = dbot.config.servers[server].admin_channel || channel.name;
|
var adminChannel = dbot.config.servers[server].admin_channel || channel.name;
|
||||||
|
|
||||||
dbot.api.users.resolveUser(server, user, function(warnee) {
|
dbot.api.users.resolveUser(server, user, function(err, warnee) {
|
||||||
if(warnee) {
|
if(warnee) {
|
||||||
var id = uuid.v4();
|
var id = uuid.v4();
|
||||||
this.db.save('warnings', id, {
|
this.db.save('warnings', id, {
|
||||||
@ -52,7 +52,7 @@ var warning = function(dbot) {
|
|||||||
|
|
||||||
'~rmwarning': function(event) {
|
'~rmwarning': function(event) {
|
||||||
var warning = null;
|
var warning = null;
|
||||||
dbot.api.users.resolveUser(event.server, event.input[1], function(warnee) {
|
dbot.api.users.resolveUser(event.server, event.input[1], function(err, warnee) {
|
||||||
if(warnee) {
|
if(warnee) {
|
||||||
this.db.search('warnings', { 'warnee': warnee.id, 'reason': event.input[2] }, function(result) {
|
this.db.search('warnings', { 'warnee': warnee.id, 'reason': event.input[2] }, function(result) {
|
||||||
warning = result;
|
warning = result;
|
||||||
@ -75,7 +75,7 @@ var warning = function(dbot) {
|
|||||||
var warnee = event.params[1],
|
var warnee = event.params[1],
|
||||||
server = event.server;
|
server = event.server;
|
||||||
|
|
||||||
dbot.api.users.resolveUser(server, warnee, function(warnee) {
|
dbot.api.users.resolveUser(server, warnee, function(err, warnee) {
|
||||||
var warnings = 0;
|
var warnings = 0;
|
||||||
this.db.search('warnings', {
|
this.db.search('warnings', {
|
||||||
'server': server,
|
'server': server,
|
||||||
|
Loading…
Reference in New Issue
Block a user