Skip to content

Commit

Permalink
fix: Fixed WPP.chat.sendLocationMessage function (wppconnect-team/wpp…
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Jul 30, 2022
1 parent 62f90ef commit 23b8cf3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/chat/functions/sendLocationMessage.ts
Expand Up @@ -14,6 +14,9 @@
* limitations under the License.
*/

import * as webpack from '../../webpack';
import { wrapModuleFunction } from '../../whatsapp/exportModule';
import { typeAttributeFromProtobuf } from '../../whatsapp/functions';
import {
defaultSendMessageOptions,
RawMessage,
Expand Down Expand Up @@ -145,3 +148,13 @@ export async function sendLocationMessage(

return await sendRawMessage(chatId, rawMessage, options);
}

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

0 comments on commit 23b8cf3

Please sign in to comment.