aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/commands/mod/speak.js
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/mod/speak.js
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 '')
-rw-r--r--server/src/commands/mod/speak.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/src/commands/mod/speak.js b/server/src/commands/mod/speak.js
index 5514545..48d38c6 100644
--- a/server/src/commands/mod/speak.js
+++ b/server/src/commands/mod/speak.js
@@ -3,6 +3,8 @@
* Author: simple
*/
+import * as UAC from "../utility/UAC/info";
+
// module constructor
export function init(core) {
if (typeof core.muzzledHashes === 'undefined') {
@@ -13,7 +15,7 @@ export function init(core) {
// module main
export async function run(core, server, socket, data) {
// increase rate limit chance and ignore if not admin or mod
- if (socket.uType === 'user') {
+ if (!UAC.isModerator(socket.level)) {
return server.police.frisk(socket.address, 10);
}
@@ -39,7 +41,7 @@ export async function run(core, server, socket, data) {
server.broadcast({
cmd: 'info',
text: `${socket.nick} unmuzzled : ${target}`,
- }, { uType: 'mod' });
+ }, { level: UAC.isModerator });
return true;
}