mirror of https://github.com/calzoneman/sync.git
only set channel rank for non-guest
This commit is contained in:
parent
ad4ee4bd02
commit
7c3f2d0a8b
|
@ -2,7 +2,7 @@
|
||||||
"author": "Calvin Montgomery",
|
"author": "Calvin Montgomery",
|
||||||
"name": "CyTube",
|
"name": "CyTube",
|
||||||
"description": "Online media synchronizer and chat",
|
"description": "Online media synchronizer and chat",
|
||||||
"version": "3.23.1",
|
"version": "3.23.2",
|
||||||
"repository": {
|
"repository": {
|
||||||
"url": "http://github.com/calzoneman/sync"
|
"url": "http://github.com/calzoneman/sync"
|
||||||
},
|
},
|
||||||
|
|
|
@ -330,18 +330,20 @@ Channel.prototype.joinUser = function (user, data) {
|
||||||
|
|
||||||
user.channel = self;
|
user.channel = self;
|
||||||
user.waitFlag(Flags.U_LOGGED_IN, () => {
|
user.waitFlag(Flags.U_LOGGED_IN, () => {
|
||||||
db.channels.getRank(self.name, user.getName(), (error, rank) => {
|
if (user.is(Flags.U_REGISTERED)) {
|
||||||
if (!error) {
|
db.channels.getRank(self.name, user.getName(), (error, rank) => {
|
||||||
user.setChannelRank(rank);
|
if (!error) {
|
||||||
user.setFlag(Flags.U_HAS_CHANNEL_RANK);
|
user.setChannelRank(rank);
|
||||||
if (user.inChannel()) {
|
user.setFlag(Flags.U_HAS_CHANNEL_RANK);
|
||||||
self.broadcastAll("setUserRank", {
|
if (user.inChannel()) {
|
||||||
name: user.getName(),
|
self.broadcastAll("setUserRank", {
|
||||||
rank: rank
|
name: user.getName(),
|
||||||
});
|
rank: rank
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (user.socket.disconnected) {
|
if (user.socket.disconnected) {
|
||||||
|
|
Loading…
Reference in New Issue