whatsapp-web.js 1.33.2 → 1.33.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -102,6 +102,7 @@ exports.ExposeStore = () => {
|
|
|
102
102
|
window.Store.PinnedMsgUtils = window.require('WAWebSendPinMessageAction');
|
|
103
103
|
window.Store.UploadUtils = window.require('WAWebUploadManager');
|
|
104
104
|
window.Store.WAWebStreamModel = window.require('WAWebStreamModel');
|
|
105
|
+
window.Store.FindOrCreateChat = window.require('WAWebFindChatAction');
|
|
105
106
|
|
|
106
107
|
window.Store.Settings = {
|
|
107
108
|
...window.require('WAWebUserPrefsGeneral'),
|
|
@@ -210,14 +211,21 @@ exports.ExposeStore = () => {
|
|
|
210
211
|
* @param {Function} callback Modified function
|
|
211
212
|
*/
|
|
212
213
|
window.injectToFunction = (target, callback) => {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
const
|
|
216
|
-
|
|
214
|
+
let module = window.require(target.module);
|
|
215
|
+
|
|
216
|
+
const path = target.function.split('.');
|
|
217
|
+
const funcName = path.pop();
|
|
218
|
+
for (const key of path) {
|
|
219
|
+
module = module[key];
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const originalFunction = module[funcName];
|
|
223
|
+
module[funcName] = (...args) => callback(originalFunction, ...args);
|
|
217
224
|
};
|
|
218
225
|
|
|
219
226
|
window.injectToFunction({ module: 'WAWebBackendJobsCommon', function: 'mediaTypeFromProtobuf' }, (func, ...args) => { const [proto] = args; return proto.locationMessage ? null : func(...args); });
|
|
220
227
|
|
|
221
228
|
window.injectToFunction({ module: 'WAWebE2EProtoUtils', function: 'typeAttributeFromProtobuf' }, (func, ...args) => { const [proto] = args; return proto.locationMessage || proto.groupInviteMessage ? 'text' : func(...args); });
|
|
222
229
|
|
|
230
|
+
window.injectToFunction({ module: 'WAWebLid1X1MigrationGating', function: 'Lid1X1MigrationUtils.isLidMigrated' }, () => false);
|
|
223
231
|
};
|
|
@@ -249,7 +249,7 @@ exports.LoadUtils = () => {
|
|
|
249
249
|
|
|
250
250
|
if (typeof chat.id?.isGroup === 'function' && chat.id.isGroup()) {
|
|
251
251
|
from = chat.groupMetadata && chat.groupMetadata.isLidAddressingMode ? lidUser : meUser;
|
|
252
|
-
participant = window.Store.WidFactory.
|
|
252
|
+
participant = window.Store.WidFactory.asUserWidOrThrow(from);
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
const newMsgKey = new window.Store.MsgKey({
|
|
@@ -539,7 +539,7 @@ exports.LoadUtils = () => {
|
|
|
539
539
|
chat = null;
|
|
540
540
|
}
|
|
541
541
|
} else {
|
|
542
|
-
chat = window.Store.Chat.get(chatWid) || (await window.Store.
|
|
542
|
+
chat = window.Store.Chat.get(chatWid) || (await window.Store.FindOrCreateChat.findOrCreateLatestChat(chatWid))?.chat;
|
|
543
543
|
}
|
|
544
544
|
|
|
545
545
|
return getAsModel && chat
|