From 5b4827ff585df5b15791bd15d76128704a116f76 Mon Sep 17 00:00:00 2001 From: icleitoncosta Date: Fri, 22 Mar 2024 23:34:17 -0300 Subject: [PATCH] fix: Fixed send list message (close #1728) --- src/chat/functions/prepareMessageButtons.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/chat/functions/prepareMessageButtons.ts b/src/chat/functions/prepareMessageButtons.ts index cf87c2f97e..d9019ce6a5 100644 --- a/src/chat/functions/prepareMessageButtons.ts +++ b/src/chat/functions/prepareMessageButtons.ts @@ -332,10 +332,14 @@ webpack.onFullReady(() => { }); wrapModuleFunction(createFanoutMsgStanza, async (func, ...args) => { - const [, , proto] = args; - let buttonNode: websocket.WapNode | null = null; + /** + * In version 2.2411.x the order of the proto arguments was changed, + * before it was the third argument, now it is the second + */ + const proto = args[1].id ? args[2] : args[1]; + if (proto.buttonsMessage) { buttonNode = websocket.smax('buttons'); } else if (proto.listMessage) {