Fix #1692 when kicker is server
This commit is contained in:
parent
f8af23c64a
commit
feb7d9d4bb
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
var _ = require("lodash");
|
var _ = require("lodash");
|
||||||
var Helper = require("../helper");
|
var Helper = require("../helper");
|
||||||
|
const User = require("./user");
|
||||||
const userLog = require("../userLog");
|
const userLog = require("../userLog");
|
||||||
const storage = require("../plugins/storage");
|
const storage = require("../plugins/storage");
|
||||||
|
|
||||||
@ -121,6 +122,10 @@ Chan.prototype.findUser = function(nick) {
|
|||||||
return _.find(this.users, {nick: nick});
|
return _.find(this.users, {nick: nick});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Chan.prototype.getUser = function(nick) {
|
||||||
|
return this.findUser(nick) || new User({nick: nick});
|
||||||
|
};
|
||||||
|
|
||||||
Chan.prototype.getMode = function(name) {
|
Chan.prototype.getMode = function(name) {
|
||||||
var user = this.findUser(name);
|
var user = this.findUser(name);
|
||||||
if (user) {
|
if (user) {
|
||||||
|
@ -11,8 +11,8 @@ module.exports = function(irc, network) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const kicker = chan.findUser(data.nick);
|
const kicker = chan.getUser(data.nick);
|
||||||
const target = chan.findUser(data.kicked);
|
const target = chan.getUser(data.kicked);
|
||||||
|
|
||||||
if (data.kicked === irc.user.nick) {
|
if (data.kicked === irc.user.nick) {
|
||||||
chan.users = [];
|
chan.users = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user