From 399b4d3cb82f87d4e6531ff513e921836e0d7f11 Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Fri, 17 Jun 2022 13:16:22 +0530 Subject: [PATCH] feat: add "device_fanout" flag for retry receipt --- src/Socket/messages-send.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Socket/messages-send.ts b/src/Socket/messages-send.ts index b1d09b1..524ecb0 100644 --- a/src/Socket/messages-send.ts +++ b/src/Socket/messages-send.ts @@ -306,6 +306,13 @@ export const makeMessagesSocket = (config: SocketConfig) => { const devices: JidWithDevice[] = [] if(participant) { + // when the retry request is not for a group + // only send to the specific device that asked for a retry + // otherwise the message is sent out to every device that should be a recipient + if(!isGroup) { + additionalAttributes = { ...additionalAttributes, device_fanout: 'false' } + } + const { user, device } = jidDecode(participant) devices.push({ user, device }) }