Add initial blocking of new users in chat
This commit is contained in:
parent
6245dc84da
commit
701d470494
4 changed files with 48 additions and 1 deletions
|
|
@ -52,7 +52,8 @@ function handleAuth(socket, accept) {
|
|||
if (!err) {
|
||||
socket.user = {
|
||||
name: user.name,
|
||||
global_rank: user.global_rank
|
||||
global_rank: user.global_rank,
|
||||
registrationTime: new Date(user.time)
|
||||
};
|
||||
}
|
||||
accept(null, true);
|
||||
|
|
@ -235,6 +236,7 @@ function handleConnection(sock) {
|
|||
user.setFlag(Flags.U_REGISTERED);
|
||||
user.clearFlag(Flags.U_READY);
|
||||
user.account.name = sock.user.name;
|
||||
user.registrationTime = sock.user.registrationTime;
|
||||
user.refreshAccount(function (err, account) {
|
||||
if (err) {
|
||||
user.clearFlag(Flags.U_REGISTERED);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue