diff options
author | MinusGix <MinusGix@gmail.com> | 2020-03-16 16:29:16 +0100 |
---|---|---|
committer | MinusGix <MinusGix@gmail.com> | 2020-03-16 16:29:16 +0100 |
commit | 713f00f99f8ba13a825cedf632e86e7364e7f540 (patch) | |
tree | 3bddd3a12d582343edd1884b4a98da087c1d0dcb | |
parent | Protocol Updates and Bug Fixes (diff) | |
download | hackchat-713f00f99f8ba13a825cedf632e86e7364e7f540.tar.gz hackchat-713f00f99f8ba13a825cedf632e86e7364e7f540.zip |
Add command to get information about users to broadcast to clients
-rw-r--r-- | server/src/commands/utility/UAC/_info.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/server/src/commands/utility/UAC/_info.js b/server/src/commands/utility/UAC/_info.js index c5010a6..7981afc 100644 --- a/server/src/commands/utility/UAC/_info.js +++ b/server/src/commands/utility/UAC/_info.js @@ -91,6 +91,23 @@ export function isTrustedUser(level) { } /** + * Return an object containing public information about the socket + * @public + * @param {WebSocket} socket Target client + * @return {Object} + */ +export function getUserDetails(socket) { + return { + uType: socket.uType, + nick: socket.nick, + trip: socket.trip || 'null', + hash: socket.hash, + level: socket.level, + userid: socket.userid, + }; +} + +/** * Returns true if the nickname is valid * @public * @param {string} nick Nickname to verify |