diff --git a/src/status/functions/sendRawStatus.ts b/src/status/functions/sendRawStatus.ts index 6b42024f58..75e2e4bfe7 100644 --- a/src/status/functions/sendRawStatus.ts +++ b/src/status/functions/sendRawStatus.ts @@ -20,9 +20,11 @@ import * as webpack from '../../webpack'; import { functions, MsgKey, UserPrefs } from '../../whatsapp'; import { wrapModuleFunction } from '../../whatsapp/exportModule'; import { + CHAT_JID, createMsgProtobuf, encryptAndSendMsg, encryptAndSendSenderKeyMsg, + GROUP_JID, randomHex, } from '../../whatsapp/functions'; import { defaultSendStatusOptions, updateParticipants } from '..'; @@ -132,4 +134,11 @@ webpack.onInjected(() => { return await func(...args); }); + + wrapModuleFunction(GROUP_JID, (func, ...args) => { + if (args[0].toString().includes('broadcast')) { + return CHAT_JID(...args); + } + return func(...args); + }); }); diff --git a/src/whatsapp/functions/GROUP_JID.ts b/src/whatsapp/functions/GROUP_JID.ts new file mode 100644 index 0000000000..b09ffeacb7 --- /dev/null +++ b/src/whatsapp/functions/GROUP_JID.ts @@ -0,0 +1,33 @@ +/*! + * Copyright 2023 WPPConnect Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { exportModule } from '../exportModule'; +import { Wid } from '../misc'; + +/** + * @whatsapp 355813 + */ +export declare function GROUP_JID(jid: Wid): any; +export declare function CHAT_JID(jid: Wid): any; + +exportModule( + exports, + { + GROUP_JID: 'GROUP_JID', + CHAT_JID: 'CHAT_JID', + }, + (m) => m.GROUP_JID && m.CHAT_JID && m.wapNodeToVoipXml +); diff --git a/src/whatsapp/functions/index.ts b/src/whatsapp/functions/index.ts index edd5b905a4..5682cda28d 100644 --- a/src/whatsapp/functions/index.ts +++ b/src/whatsapp/functions/index.ts @@ -66,6 +66,7 @@ export * from './getReactions'; export * from './getSearchContext'; export * from './getVotes'; export * from './getWhatsAppWebExternalBetaJoinedIdb'; +export * from './GROUP_JID'; export * from './groupParticipants'; export * from './handleAck'; export * from './handleSingleMsg';