Merge pull request #1621 from thecodingmachine/fix_empty_submessage

Fix sending empty variable message for users that have no right to re…
This commit is contained in:
David Négrier 2021-12-03 17:23:04 +01:00 committed by GitHub
commit 936a6bfeec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,11 +100,11 @@ export class PusherRoom {
// Let's dispatch this variable to all the listeners // Let's dispatch this variable to all the listeners
for (const listener of this.listeners) { for (const listener of this.listeners) {
const subMessage = new SubMessage();
if (!readableBy || listener.tags.includes(readableBy)) { if (!readableBy || listener.tags.includes(readableBy)) {
const subMessage = new SubMessage();
subMessage.setVariablemessage(variableMessage); subMessage.setVariablemessage(variableMessage);
listener.emitInBatch(subMessage);
} }
listener.emitInBatch(subMessage);
} }
} else if (message.hasErrormessage()) { } else if (message.hasErrormessage()) {
const errorMessage = message.getErrormessage() as ErrorMessage; const errorMessage = message.getErrormessage() as ErrorMessage;