From 0023879e9c6f9cb12d1676659f2eaf46558cb538 Mon Sep 17 00:00:00 2001 From: Rajeh Taher Date: Sat, 4 Mar 2023 00:10:03 +0200 Subject: [PATCH] Update Injected.js --- src/util/Injected.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/util/Injected.js b/src/util/Injected.js index eb4f6c5..d5cd714 100644 --- a/src/util/Injected.js +++ b/src/util/Injected.js @@ -251,20 +251,31 @@ exports.ExposeStore = (moduleRaidStr) => { index: 0, name: 'typeAttributeFromProtobuf', property: 'typeAttributeFromProtobuf' - }, (func, args) => { + }, function callback(func, args) { const [proto] = args; if (proto.ephemeralMessage) { const { message } = proto.ephemeralMessage; - return message ? func(message) : 'text'; + return message ? callback(func, [message]) : 'text'; } if (proto.deviceSentMessage) { const { message } = proto.deviceSentMessage; - return message ? func(message) : 'text'; + return message ? callback(func, [message]) : 'text'; } if (proto.viewOnceMessage) { const { message } = proto.viewOnceMessage; - return message ? func(message) : 'text'; + return message ? callback(func, [message]) : 'text'; + } + + if ( + proto.buttonsMessage?.headerType === 1 || + proto.buttonsMessage?.headerType === 2 + ) { + return 'text'; + } + + if (proto.listMessage) { + return 'text'; } if (proto.templateMessage?.hydratedTemplate) { @@ -280,17 +291,6 @@ exports.ExposeStore = (moduleRaidStr) => { } return 'text'; } - - if ( - proto.buttonsMessage?.headerType === 1 || - proto.buttonsMessage?.headerType === 2 - ) { - return 'text'; - } - - if (proto.listMessage) { - return 'text'; - } return func(...args); });