diff --git a/package.json b/package.json index 634c35f9..1cc4917b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Calvin Montgomery", "name": "CyTube", "description": "Online media synchronizer and chat", - "version": "3.17.2", + "version": "3.17.3", "repository": { "url": "http://github.com/calzoneman/sync" }, diff --git a/src/channel/channel.js b/src/channel/channel.js index f999f70a..f58ba98c 100644 --- a/src/channel/channel.js +++ b/src/channel/channel.js @@ -323,15 +323,20 @@ Channel.prototype.joinUser = function (user, data) { } if (self.is(Flags.C_REGISTERED)) { - user.refreshAccount({ channel: self.name }, function (err, account) { - if (err) { - Logger.errlog.log("user.refreshAccount failed at Channel.joinUser"); - Logger.errlog.log(err.stack); - self.refCounter.unref("Channel::user"); - return; - } + user.waitFlag(Flags.U_LOGGED_IN, () => { + user.refreshAccount({ + channel: self.name, + name: user.getName() + }, function (err, account) { + if (err) { + Logger.errlog.log("user.refreshAccount failed at Channel.joinUser"); + Logger.errlog.log(err.stack); + self.refCounter.unref("Channel::user"); + return; + } - afterAccount(); + afterAccount(); + }); }); } else { afterAccount();