Update Injected.js

This commit is contained in:
Rajeh Taher
2023-03-04 00:10:03 +02:00
committed by GitHub
parent eafdfe12f2
commit 0023879e9c

View File

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