diff --git a/src/puppet-padchat/puppet-padchat.ts b/src/puppet-padchat/puppet-padchat.ts index 6a2a9ab88db98a2c92a96d54c55809af82f657a4..5d0d9617af7bd7bd7776baa140991ffe3d9ab815 100644 --- a/src/puppet-padchat/puppet-padchat.ts +++ b/src/puppet-padchat/puppet-padchat.ts @@ -724,7 +724,10 @@ export class PuppetPadchat extends Puppet { text : string, ): Promise { log.verbose('PuppetPadchat', 'messageSend(%s, %s)', JSON.stringify(receiver), text) - const id = receiver.contactId || receiver.roomId + + // roomId first, contactId second. + const id = receiver.roomId || receiver.contactId + if (!id) { throw Error('no id') } @@ -740,7 +743,9 @@ export class PuppetPadchat extends Puppet { ): Promise { log.verbose('PuppetPadchat', 'messageSend("%s", %s)', JSON.stringify(receiver), file) - const id = receiver.contactId || receiver.roomId + // roomId first, contactId second. + const id = receiver.roomId || receiver.contactId + if (!id) { throw new Error('no id!') } @@ -779,7 +784,9 @@ export class PuppetPadchat extends Puppet { throw new Error('no bridge') } - const id = receiver.contactId || receiver.roomId + // roomId first, contactId second. + const id = receiver.roomId || receiver.contactId + if (!id) { throw Error('no id') }