From 7ffa10a5c5aa6d35e26ac886132a2100c6e7d34d Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Thu, 6 Jan 2022 15:11:33 +0530 Subject: [PATCH] fix: delivery receipt --- src/Socket/messages-recv.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Socket/messages-recv.ts b/src/Socket/messages-recv.ts index dc800e0..4cce50f 100644 --- a/src/Socket/messages-recv.ts +++ b/src/Socket/messages-recv.ts @@ -13,7 +13,13 @@ const STATUS_MAP: { [_: string]: proto.WebMessageInfo.WebMessageInfoStatus } = { 'read-self': proto.WebMessageInfo.WebMessageInfoStatus.READ } -const getStatusFromReceiptType = (type: string | undefined) => STATUS_MAP[type] +const getStatusFromReceiptType = (type: string | undefined) => { + const status = STATUS_MAP[type] + if(typeof type === 'undefined') { + return proto.WebMessageInfo.WebMessageInfoStatus.DELIVERY_ACK + } + return status +} export const makeMessagesRecvSocket = (config: SocketConfig) => { const { logger } = config