only set channel rank for non-guest

This commit is contained in:
Calvin Montgomery 2016-10-06 23:22:02 -07:00
parent ad4ee4bd02
commit 7c3f2d0a8b
2 changed files with 14 additions and 12 deletions

View File

@ -2,7 +2,7 @@
"author": "Calvin Montgomery",
"name": "CyTube",
"description": "Online media synchronizer and chat",
"version": "3.23.1",
"version": "3.23.2",
"repository": {
"url": "http://github.com/calzoneman/sync"
},

View File

@ -330,18 +330,20 @@ Channel.prototype.joinUser = function (user, data) {
user.channel = self;
user.waitFlag(Flags.U_LOGGED_IN, () => {
db.channels.getRank(self.name, user.getName(), (error, rank) => {
if (!error) {
user.setChannelRank(rank);
user.setFlag(Flags.U_HAS_CHANNEL_RANK);
if (user.inChannel()) {
self.broadcastAll("setUserRank", {
name: user.getName(),
rank: rank
});
if (user.is(Flags.U_REGISTERED)) {
db.channels.getRank(self.name, user.getName(), (error, rank) => {
if (!error) {
user.setChannelRank(rank);
user.setFlag(Flags.U_HAS_CHANNEL_RANK);
if (user.inChannel()) {
self.broadcastAll("setUserRank", {
name: user.getName(),
rank: rank
});
}
}
}
});
});
}
});
if (user.socket.disconnected) {