Fix a bug with passwords for bot logins

This commit is contained in:
calzoneman 2016-07-03 23:50:16 -07:00
parent edb5fb6f4e
commit f75d40d278
1 changed files with 4 additions and 2 deletions

View File

@ -31,11 +31,13 @@ AccessControlModule.prototype.onUserPreJoin = function (user, data, cb) {
user.socket.emit("needPassword", typeof data.pw !== "undefined"); user.socket.emit("needPassword", typeof data.pw !== "undefined");
/* Option 1: log in as a moderator */ /* Option 1: log in as a moderator */
user.waitFlag(Flags.U_LOGGED_IN, function () { user.waitFlag(Flags.U_LOGGED_IN, function () {
user.refreshAccount({ channel: self.channel.name }, function (err, account) { user.channel = chan;
user.refreshAccount(function (err, account) {
/* Already joined the channel by some other condition */ /* Already joined the channel by some other condition */
if (user.is(Flags.U_IN_CHANNEL)) { if (user.is(Flags.U_IN_CHANNEL)) {
return; return;
} else if (user.channel === chan) {
user.channel = null;
} }
if (account.effectiveRank >= 2) { if (account.effectiveRank >= 2) {