@@ -1815,7 +1815,7 @@ client.initialize();
diff --git a/docs/structures_Base.js.html b/docs/structures_Base.js.html index 36c00de..c1dbcaa 100644 --- a/docs/structures_Base.js.html +++ b/docs/structures_Base.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.2.4 » Source: structures/Base.js + whatsapp-web.js 1.2.5 » Source: structures/Base.js @@ -15,7 +15,7 @@ @@ -60,7 +60,7 @@ module.exports = Base;
diff --git a/docs/structures_BusinessContact.js.html b/docs/structures_BusinessContact.js.html index 67967cf..ebac4ba 100644 --- a/docs/structures_BusinessContact.js.html +++ b/docs/structures_BusinessContact.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.2.4 » Source: structures/BusinessContact.js + whatsapp-web.js 1.2.5 » Source: structures/BusinessContact.js @@ -15,7 +15,7 @@ @@ -59,7 +59,7 @@ module.exports = BusinessContact;
diff --git a/docs/structures_Chat.js.html b/docs/structures_Chat.js.html index 033c9c4..2ea997c 100644 --- a/docs/structures_Chat.js.html +++ b/docs/structures_Chat.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.2.4 » Source: structures/Chat.js + whatsapp-web.js 1.2.5 » Source: structures/Chat.js @@ -15,7 +15,7 @@ @@ -215,7 +215,7 @@ module.exports = Chat;
diff --git a/docs/structures_ClientInfo.js.html b/docs/structures_ClientInfo.js.html index 4f3d4f9..23b8959 100644 --- a/docs/structures_ClientInfo.js.html +++ b/docs/structures_ClientInfo.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.2.4 » Source: structures/ClientInfo.js + whatsapp-web.js 1.2.5 » Source: structures/ClientInfo.js @@ -15,7 +15,7 @@ @@ -89,7 +89,7 @@ module.exports = ClientInfo;
diff --git a/docs/structures_Contact.js.html b/docs/structures_Contact.js.html index 0578382..32a433b 100644 --- a/docs/structures_Contact.js.html +++ b/docs/structures_Contact.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.2.4 » Source: structures/Contact.js + whatsapp-web.js 1.2.5 » Source: structures/Contact.js @@ -15,7 +15,7 @@ @@ -153,7 +153,7 @@ module.exports = Contact;
diff --git a/docs/structures_GroupChat.js.html b/docs/structures_GroupChat.js.html index 7d83ee1..4fec7b0 100644 --- a/docs/structures_GroupChat.js.html +++ b/docs/structures_GroupChat.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.2.4 » Source: structures/GroupChat.js + whatsapp-web.js 1.2.5 » Source: structures/GroupChat.js @@ -15,7 +15,7 @@ @@ -209,7 +209,7 @@ module.exports = GroupChat;
diff --git a/docs/structures_GroupNotification.js.html b/docs/structures_GroupNotification.js.html index d88c591..563c2ab 100644 --- a/docs/structures_GroupNotification.js.html +++ b/docs/structures_GroupNotification.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.2.4 » Source: structures/GroupNotification.js + whatsapp-web.js 1.2.5 » Source: structures/GroupNotification.js @@ -15,7 +15,7 @@ @@ -143,7 +143,7 @@ module.exports = GroupNotification;
diff --git a/docs/structures_Location.js.html b/docs/structures_Location.js.html index 2cf1bff..7dbb12a 100644 --- a/docs/structures_Location.js.html +++ b/docs/structures_Location.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.2.4 » Source: structures/Location.js + whatsapp-web.js 1.2.5 » Source: structures/Location.js @@ -15,7 +15,7 @@ @@ -71,7 +71,7 @@ module.exports = Location;
diff --git a/docs/structures_Message.js.html b/docs/structures_Message.js.html index a7197ff..1acf19f 100644 --- a/docs/structures_Message.js.html +++ b/docs/structures_Message.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.2.4 » Source: structures/Message.js + whatsapp-web.js 1.2.5 » Source: structures/Message.js @@ -15,7 +15,7 @@ @@ -217,12 +217,18 @@ class Message extends Base { return undefined; } - const {data, mimetype, filename} = await this.client.pupPage.evaluate(async (msgId) => { + const result = await this.client.pupPage.evaluate(async (msgId) => { const msg = window.Store.Msg.get(msgId); if(msg.mediaData.mediaStage != 'RESOLVED') { + // try to resolve media await msg.downloadMedia(true, 1); } + + if(msg.mediaData.mediaStage != 'RESOLVED') { + // media could not be downloaded + return undefined; + } const buffer = await window.WWebJS.downloadBuffer(msg.clientUrl); const decrypted = await window.Store.CryptoLib.decryptE2EMedia(msg.type, buffer, msg.mediaKey, msg.mimetype); @@ -236,7 +242,8 @@ class Message extends Base { }, this.id._serialized); - return new MessageMedia(mimetype, data, filename); + if(!result) return undefined; + return new MessageMedia(result.mimetype, result.data, result.filename); } /** @@ -267,7 +274,7 @@ module.exports = Message;
diff --git a/docs/structures_MessageMedia.js.html b/docs/structures_MessageMedia.js.html index 4f019f7..cd17eee 100644 --- a/docs/structures_MessageMedia.js.html +++ b/docs/structures_MessageMedia.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.2.4 » Source: structures/MessageMedia.js + whatsapp-web.js 1.2.5 » Source: structures/MessageMedia.js @@ -15,7 +15,7 @@ @@ -69,7 +69,7 @@ module.exports = MessageMedia;
diff --git a/docs/structures_PrivateChat.js.html b/docs/structures_PrivateChat.js.html index 121314d..ae091a4 100644 --- a/docs/structures_PrivateChat.js.html +++ b/docs/structures_PrivateChat.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.2.4 » Source: structures/PrivateChat.js + whatsapp-web.js 1.2.5 » Source: structures/PrivateChat.js @@ -15,7 +15,7 @@ @@ -51,7 +51,7 @@ module.exports = PrivateChat;
diff --git a/docs/structures_PrivateContact.js.html b/docs/structures_PrivateContact.js.html index 8a25df2..088b7a7 100644 --- a/docs/structures_PrivateContact.js.html +++ b/docs/structures_PrivateContact.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.2.4 » Source: structures/PrivateContact.js + whatsapp-web.js 1.2.5 » Source: structures/PrivateContact.js @@ -15,7 +15,7 @@ @@ -51,7 +51,7 @@ module.exports = PrivateContact;
diff --git a/docs/util_Constants.js.html b/docs/util_Constants.js.html index d997a88..4d06b7f 100644 --- a/docs/util_Constants.js.html +++ b/docs/util_Constants.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.2.4 » Source: util/Constants.js + whatsapp-web.js 1.2.5 » Source: util/Constants.js @@ -15,7 +15,7 @@ @@ -166,7 +166,7 @@ exports.MessageAck = {
diff --git a/docs/util_Util.js.html b/docs/util_Util.js.html index a858160..3174264 100644 --- a/docs/util_Util.js.html +++ b/docs/util_Util.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.2.4 » Source: util/Util.js + whatsapp-web.js 1.2.5 » Source: util/Util.js @@ -15,7 +15,7 @@ @@ -73,7 +73,7 @@ module.exports = Util; diff --git a/package.json b/package.json index 592baa8..5fc5249 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "whatsapp-web.js", - "version": "1.2.4-post", + "version": "1.2.5", "description": "Library for interacting with the WhatsApp Web API ", "main": "./index.js", "scripts": {