mirror of
https://github.com/thelounge/thelounge
synced 2024-11-10 22:54:15 +00:00
Merge pull request #1693 from thelounge/xpaw/fix-1692
Fix #1692 when kicker is server
This commit is contained in:
commit
48b6a136d1
2 changed files with 7 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
var _ = require("lodash");
|
||||
var Helper = require("../helper");
|
||||
const User = require("./user");
|
||||
const userLog = require("../userLog");
|
||||
const storage = require("../plugins/storage");
|
||||
|
||||
|
@ -121,6 +122,10 @@ Chan.prototype.findUser = function(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) {
|
||||
var user = this.findUser(name);
|
||||
if (user) {
|
||||
|
|
|
@ -11,8 +11,8 @@ module.exports = function(irc, network) {
|
|||
return;
|
||||
}
|
||||
|
||||
const kicker = chan.findUser(data.nick);
|
||||
const target = chan.findUser(data.kicked);
|
||||
const kicker = chan.getUser(data.nick);
|
||||
const target = chan.getUser(data.kicked);
|
||||
|
||||
if (data.kicked === irc.user.nick) {
|
||||
chan.users = [];
|
||||
|
|
Loading…
Reference in a new issue