aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/commands/utility/UAC
diff options
context:
space:
mode:
authormarzavec <admin@marzavec.com>2020-03-16 16:50:21 +0100
committerGitHub <noreply@github.com>2020-03-16 16:50:21 +0100
commitbe310af3bd7f38b2c17d5fbec6f75ac903fd4750 (patch)
treeeece3fdefbe2cb023c90563f2f9ddd74fce8d867 /server/src/commands/utility/UAC
parentMerge pull request #99 from MinusGix/joinToHash (diff)
parentMake ban command broadcast information about user and banner (diff)
downloadhackchat-be310af3bd7f38b2c17d5fbec6f75ac903fd4750.tar.gz
hackchat-be310af3bd7f38b2c17d5fbec6f75ac903fd4750.zip
Merge pull request #98 from MinusGix/BanMinor
More verbose ban event + UAC getUserDetails additions
Diffstat (limited to '')
-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