aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/commands/utility
diff options
context:
space:
mode:
authorMinusGix <MinusGix@gmail.com>2020-03-16 16:29:16 +0100
committerMinusGix <MinusGix@gmail.com>2020-03-16 16:29:16 +0100
commit713f00f99f8ba13a825cedf632e86e7364e7f540 (patch)
tree3bddd3a12d582343edd1884b4a98da087c1d0dcb /server/src/commands/utility
parentProtocol Updates and Bug Fixes (diff)
downloadhackchat-713f00f99f8ba13a825cedf632e86e7364e7f540.tar.gz
hackchat-713f00f99f8ba13a825cedf632e86e7364e7f540.zip
Add command to get information about users to broadcast to clients
Diffstat (limited to 'server/src/commands/utility')
-rw-r--r--server/src/commands/utility/UAC/_info.js17
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