aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/serverLib/MainServer.js
diff options
context:
space:
mode:
authormarzavec <admin@marzavec.com>2019-10-03 19:48:30 +0200
committermarzavec <admin@marzavec.com>2019-10-03 19:48:30 +0200
commitaeec2be24f3d5698f16bb81dadae3f59084877dc (patch)
tree82b396f72f753fdc6b00ff07277261f5bc354813 /server/src/serverLib/MainServer.js
parentClient update (diff)
downloadhackchat-aeec2be24f3d5698f16bb81dadae3f59084877dc.tar.gz
hackchat-aeec2be24f3d5698f16bb81dadae3f59084877dc.zip
Outgoing Hook Fix + Package Changes
Diffstat (limited to 'server/src/serverLib/MainServer.js')
-rw-r--r--server/src/serverLib/MainServer.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/src/serverLib/MainServer.js b/server/src/serverLib/MainServer.js
index c55b732..8ef5129 100644
--- a/server/src/serverLib/MainServer.js
+++ b/server/src/serverLib/MainServer.js
@@ -363,10 +363,12 @@ class MainServer extends WsServer {
// notify each module to register their hooks (if any)
this.core.commands.initCommandHooks(this);
+ let curHooks = [];
+ let hookObj = [];
+
if (typeof this.hooks['in'] !== 'undefined') {
// start sorting, with incoming first
- let curHooks = [ ...this.hooks['in'].keys() ];
- let hookObj = [];
+ curHooks = [ ...this.hooks['in'].keys() ];
for (let i = 0, j = curHooks.length; i < j; i++) {
hookObj = this.hooks['in'].get(curHooks[i]);
hookObj.sort( (h1, h2) => h1.priority - h2.priority );