Skip to content

Commit

Permalink
fix: Fixed WPP.chat.sendLocationMessage function (fix #1187)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Jun 17, 2023
1 parent 84c627d commit 4b07663
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/chat/functions/sendLocationMessage.ts
Expand Up @@ -16,7 +16,10 @@

import * as webpack from '../../webpack';
import { wrapModuleFunction } from '../../whatsapp/exportModule';
import { typeAttributeFromProtobuf } from '../../whatsapp/functions';
import {
mediaTypeFromProtobuf,
typeAttributeFromProtobuf,
} from '../../whatsapp/functions';
import {
defaultSendMessageOptions,
RawMessage,
Expand Down Expand Up @@ -150,6 +153,14 @@ export async function sendLocationMessage(
}

webpack.onInjected(() => {
wrapModuleFunction(mediaTypeFromProtobuf, (func, ...args) => {
const [proto] = args;
if (proto.locationMessage) {
return null;
}
return func(...args);
});

wrapModuleFunction(typeAttributeFromProtobuf, (func, ...args) => {
const [proto] = args;
if (proto.locationMessage) {
Expand Down

0 comments on commit 4b07663

Please sign in to comment.