forked from hippoz/brainlet
fix #10
This commit is contained in:
parent
7d1882895b
commit
6c5470e6b1
1 changed files with 19 additions and 15 deletions
|
@ -226,6 +226,7 @@ GatewayServer.prototype.eventSetup = function() {
|
|||
|
||||
socket.on('subscribe', async (categories) => {
|
||||
if ( !socket.isConnected || !socket.user || !categories || !Array.isArray(categories) || categories === []) return;
|
||||
try {
|
||||
for (const v of categories) {
|
||||
if (!v && !(typeof v === 'string')) continue;
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('disconnecting', async () => {
|
||||
|
|
Loading…
Reference in a new issue