diff --git a/src/lib/DecodedMessage.ts b/src/lib/DecodedMessage.ts index 103e3116c..b5f7b23c2 100644 --- a/src/lib/DecodedMessage.ts +++ b/src/lib/DecodedMessage.ts @@ -9,6 +9,10 @@ import { ReplyCodec } from './NativeCodecs/ReplyCodec' import { TextCodec } from './NativeCodecs/TextCodec' import { Buffer } from 'buffer' +const allowEmptyProperties: (keyof NativeMessageContent)[] = [ + 'text', + 'readReceipt', +] export class DecodedMessage { client: Client id: string @@ -100,7 +104,9 @@ export class DecodedMessage { for (const codec of Object.values(this.client.codecRegistry)) { if ( ('contentKey' in codec && this.nativeContent[codec.contentKey]) || - this.nativeContent.hasOwnProperty('text') + allowEmptyProperties.some((prop) => + this.nativeContent.hasOwnProperty(prop) + ) ) { return (codec as NativeContentCodec).decode( this.nativeContent