Skip to content

Commit

Permalink
fix: Fixed send status error (#1540)
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Dec 15, 2023
1 parent 01c4a18 commit fe69680
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/status/functions/sendRawStatus.ts
Expand Up @@ -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 '..';
Expand Down Expand Up @@ -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);
});
});
33 changes: 33 additions & 0 deletions 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
);
1 change: 1 addition & 0 deletions src/whatsapp/functions/index.ts
Expand Up @@ -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';
Expand Down

0 comments on commit fe69680

Please sign in to comment.