From bd670400866bc98482678c312436ef76f2a9b34d Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 8 Jul 2020 10:13:21 +1000 Subject: [PATCH] handle empty group id after decoding and set it to null --- ts/receiver/dataMessage.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ts/receiver/dataMessage.ts b/ts/receiver/dataMessage.ts index bc4dca817..ff01c07c3 100644 --- a/ts/receiver/dataMessage.ts +++ b/ts/receiver/dataMessage.ts @@ -435,6 +435,14 @@ export function initIncomingMessage(data: MessageCreationData): MessageModel { } = data; const type = 'incoming'; + if ( + message && + message.group && + message.group.id && + message.group.id.length === 0 + ) { + message.group.id = null; + } const groupId = message?.group?.id; const messageData: any = { @@ -614,10 +622,11 @@ export async function handleMessageEvent(event: any): Promise { const primarySource = await MultiDeviceProtocol.getPrimaryDevice(source); if (isGroupMessage) { /* handle one part of the group logic here: - handle requesting info of a new group, - dropping an admin only update from a non admin, ... - */ + handle requesting info of a new group, + dropping an admin only update from a non admin, ... + */ conversationId = message.group.id; + const shouldReturn = await preprocessGroupMessage( source, message.group,