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); });