forked from hippoz/brainlet
add individual user froce refresh
This commit is contained in:
parent
8321cefa78
commit
e998a26fd0
1 changed files with 18 additions and 0 deletions
|
@ -68,6 +68,24 @@ GatewayServer.prototype._processCommand = function(socket, message) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'admin/fru': {
|
||||||
|
if (args === 1) {
|
||||||
|
if (socket.user.permissionLevel >= config.roleMap.ADMIN) {
|
||||||
|
const user = await this._findSocketInRoom(message.category._id, fullCommand[1]);
|
||||||
|
if (!user) {
|
||||||
|
this._sendSystemMessage(socket, 'User not found.', message.category);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._gateway.in(user.user.sid).emit('refreshClient', { reason: 'REFRESH' });
|
||||||
|
} else {
|
||||||
|
this._sendSystemMessage(socket, 'how about no', message.category);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this._sendSystemMessage(socket, 'Invalid number of arguments.', message.category);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
this._sendSystemMessage(socket, 'That command does not exist.', message.category);
|
this._sendSystemMessage(socket, 'That command does not exist.', message.category);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue