mirror of https://github.com/calzoneman/sync.git
Fix duplicate userLeave
This commit is contained in:
parent
d598675576
commit
b6dcbe4d46
|
@ -372,9 +372,7 @@ Channel.prototype.partUser = function (user) {
|
||||||
user.clearFlag(Flags.U_IN_CHANNEL);
|
user.clearFlag(Flags.U_IN_CHANNEL);
|
||||||
|
|
||||||
if (user.is(Flags.U_LOGGED_IN)) {
|
if (user.is(Flags.U_LOGGED_IN)) {
|
||||||
this.users.forEach(function (u) {
|
this.broadcastAll("userLeave", { name: user.getName() });
|
||||||
u.socket.emit("userLeave", { name: user.getName() });
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var idx = this.users.indexOf(user);
|
var idx = this.users.indexOf(user);
|
||||||
|
@ -386,7 +384,6 @@ Channel.prototype.partUser = function (user) {
|
||||||
Object.keys(this.modules).forEach(function (m) {
|
Object.keys(this.modules).forEach(function (m) {
|
||||||
self.modules[m].onUserPart(user);
|
self.modules[m].onUserPart(user);
|
||||||
});
|
});
|
||||||
this.sendUserLeave(this.users, user);
|
|
||||||
this.sendUsercount(this.users);
|
this.sendUsercount(this.users);
|
||||||
|
|
||||||
this.activeLock.release();
|
this.activeLock.release();
|
||||||
|
@ -535,16 +532,6 @@ Channel.prototype.sendUserJoin = function (users, user) {
|
||||||
user.account.aliases.join(",") + ")", 2);
|
user.account.aliases.join(",") + ")", 2);
|
||||||
};
|
};
|
||||||
|
|
||||||
Channel.prototype.sendUserLeave = function (users, user) {
|
|
||||||
var data = {
|
|
||||||
name: user.getName()
|
|
||||||
};
|
|
||||||
|
|
||||||
users.forEach(function (u) {
|
|
||||||
u.socket.emit("userLeave", data);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
Channel.prototype.readLog = function (shouldMaskIP, cb) {
|
Channel.prototype.readLog = function (shouldMaskIP, cb) {
|
||||||
var maxLen = 102400;
|
var maxLen = 102400;
|
||||||
var file = this.logger.filename;
|
var file = this.logger.filename;
|
||||||
|
|
Loading…
Reference in New Issue