diff --git a/api/v1/gateway/index.js b/api/v1/gateway/index.js index 4bc6e30..258817d 100644 --- a/api/v1/gateway/index.js +++ b/api/v1/gateway/index.js @@ -68,6 +68,24 @@ GatewayServer.prototype._processCommand = function(socket, message) { } 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: { this._sendSystemMessage(socket, 'That command does not exist.', message.category); break;