add individual user froce refresh

This commit is contained in:
hippoz 2020-12-08 00:25:27 +02:00
parent 8321cefa78
commit e998a26fd0

View file

@ -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;