Skip to content

Commit

Permalink
fix: Fixed compatibility with WhatsApp >= 2.2241.6
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Oct 25, 2022
1 parent ebea641 commit 2d26a83
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 35 deletions.
16 changes: 14 additions & 2 deletions src/conn/functions/isMultiDevice.ts
Expand Up @@ -14,8 +14,20 @@
* limitations under the License.
*/

import { isMDBackend } from '../../whatsapp/functions';
import * as webpack from '../../webpack';

export function isMultiDevice(): boolean {
return isMDBackend();
/**
* backward compatibility with < 2.2241.6
*/
const m = webpack.search((m) => m.isMDBackend);

if (m?.isMDBackend) {
return m.isMDBackend();
}

/**
* always true for >= 2.2241.6
*/
return true;
}
1 change: 0 additions & 1 deletion src/whatsapp/functions/index.ts
Expand Up @@ -35,7 +35,6 @@ export * from './getOrGenerate';
export * from './groupParticipants';
export * from './handleAck';
export * from './isAuthenticated';
export * from './isMDBackend';
export * from './markSeen';
export * from './mediaTypeFromProtobuf';
export * from './msgFindQuery';
Expand Down
32 changes: 0 additions & 32 deletions src/whatsapp/functions/isMDBackend.ts

This file was deleted.

0 comments on commit 2d26a83

Please sign in to comment.