aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/commands/core
diff options
context:
space:
mode:
authorMinusGix <MinusGix@gmail.com>2020-03-05 17:49:25 +0100
committerMinusGix <MinusGix@gmail.com>2020-03-05 17:49:25 +0100
commit50737bc0d9c1ae806610e76be013eeddca1bf102 (patch)
treedaf36b87a9863a798d201242d0bbc68d39cda56d /server/src/commands/core
parentMake join apply UAC levels to sockets and userInfo (diff)
downloadhackchat-50737bc0d9c1ae806610e76be013eeddca1bf102.tar.gz
hackchat-50737bc0d9c1ae806610e76be013eeddca1bf102.zip
Move most uses of uType filtering to use UAC levels
Diffstat (limited to 'server/src/commands/core')
-rw-r--r--server/src/commands/core/chat.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/src/commands/core/chat.js b/server/src/commands/core/chat.js
index 6c491b1..01ee256 100644
--- a/server/src/commands/core/chat.js
+++ b/server/src/commands/core/chat.js
@@ -2,6 +2,8 @@
Description: Rebroadcasts any `text` to all clients in a `channel`
*/
+import * as UAC from "../utility/UAC/info";
+
// module support functions
const parseText = (text) => {
// verifies user input is text
@@ -43,11 +45,12 @@ export async function run(core, server, socket, data) {
cmd: 'chat',
nick: socket.nick,
text,
+ level: socket.level
};
- if (socket.uType === 'admin') {
+ if (UAC.isAdmin(socket.level)) {
payload.admin = true;
- } else if (socket.uType === 'mod') {
+ } else if (UAC.isModerator(socket.level)) {
payload.mod = true;
}