This commit is contained in:
hippoz 2021-01-03 17:04:23 +02:00
parent 7d1882895b
commit 6c5470e6b1
Signed by untrusted user who does not match committer: hippoz
GPG key ID: 7C52899193467641

View file

@ -226,6 +226,7 @@ GatewayServer.prototype.eventSetup = function() {
socket.on('subscribe', async (categories) => { socket.on('subscribe', async (categories) => {
if ( !socket.isConnected || !socket.user || !categories || !Array.isArray(categories) || categories === []) return; if ( !socket.isConnected || !socket.user || !categories || !Array.isArray(categories) || categories === []) return;
try {
for (const v of categories) { for (const v of categories) {
if (!v && !(typeof v === 'string')) continue; if (!v && !(typeof v === 'string')) continue;
// TODO: When/if category permissions are added, check if the user has permissions for that category // TODO: When/if category permissions are added, check if the user has permissions for that category
@ -242,6 +243,9 @@ GatewayServer.prototype.eventSetup = function() {
this._gateway.in(v).emit('clientListUpdate', upd); this._gateway.in(v).emit('clientListUpdate', upd);
} }
} }
} catch (e) {
return;
}
}); });
socket.on('disconnecting', async () => { socket.on('disconnecting', async () => {