diff --git a/docs/Base.html b/docs/Base.html
index fe20c88..8ffffec 100644
--- a/docs/Base.html
+++ b/docs/Base.html
@@ -4,7 +4,7 @@
-

+

whatsapp-web.js
A WhatsApp API client that connects through the WhatsApp Web browser app
It uses Puppeteer to run a real instance of Whatsapp Web to avoid getting blocked.
@@ -1815,7 +1815,7 @@ client.initialize();
diff --git a/docs/structures_Base.js.html b/docs/structures_Base.js.html
index 568476a..7e85d3d 100644
--- a/docs/structures_Base.js.html
+++ b/docs/structures_Base.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.2.0 » Source: structures/Base.js
+ whatsapp-web.js 1.2.1 » 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 109ac3a..7036df8 100644
--- a/docs/structures_BusinessContact.js.html
+++ b/docs/structures_BusinessContact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.2.0 » Source: structures/BusinessContact.js
+ whatsapp-web.js 1.2.1 » 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 8cdcdca..332b905 100644
--- a/docs/structures_Chat.js.html
+++ b/docs/structures_Chat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.2.0 » Source: structures/Chat.js
+ whatsapp-web.js 1.2.1 » Source: structures/Chat.js
@@ -15,7 +15,7 @@
@@ -162,14 +162,14 @@ class Chat extends Base {
while(msgs.length < limit) {
const loadedMessages = await chat.loadEarlierMsgs();
if(!loadedMessages) break;
- msgs = [...msgs, ...loadedMessages.filter(msgFilter)];
+ msgs = [...loadedMessages.filter(msgFilter), ...msgs];
}
- return msgs.splice(0, limit).map(m => m.serialize());
+ msgs.sort((a, b) => (a.t > b.t) ? 1 : -1);
+ return msgs.splice(msgs.length - limit).map(m => m.serialize());
}, this.id._serialized, searchOptions.limit);
- messages.sort((a, b) => (a.t > b.t) ? 1 : -1);
return messages.map(m => new Message(this.client, m));
}
@@ -215,7 +215,7 @@ module.exports = Chat;
diff --git a/docs/structures_ClientInfo.js.html b/docs/structures_ClientInfo.js.html
index b9ebef0..31b6bb9 100644
--- a/docs/structures_ClientInfo.js.html
+++ b/docs/structures_ClientInfo.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.2.0 » Source: structures/ClientInfo.js
+ whatsapp-web.js 1.2.1 » 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 77e4548..d23eb51 100644
--- a/docs/structures_Contact.js.html
+++ b/docs/structures_Contact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.2.0 » Source: structures/Contact.js
+ whatsapp-web.js 1.2.1 » 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 6b4dc55..a5c3107 100644
--- a/docs/structures_GroupChat.js.html
+++ b/docs/structures_GroupChat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.2.0 » Source: structures/GroupChat.js
+ whatsapp-web.js 1.2.1 » 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 3582ee4..7845a65 100644
--- a/docs/structures_GroupNotification.js.html
+++ b/docs/structures_GroupNotification.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.2.0 » Source: structures/GroupNotification.js
+ whatsapp-web.js 1.2.1 » 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 ec229a0..f4ce25e 100644
--- a/docs/structures_Location.js.html
+++ b/docs/structures_Location.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.2.0 » Source: structures/Location.js
+ whatsapp-web.js 1.2.1 » 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 cc8a48e..4362f42 100644
--- a/docs/structures_Message.js.html
+++ b/docs/structures_Message.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.2.0 » Source: structures/Message.js
+ whatsapp-web.js 1.2.1 » Source: structures/Message.js
@@ -15,7 +15,7 @@
@@ -262,7 +262,7 @@ module.exports = Message;
diff --git a/docs/structures_MessageMedia.js.html b/docs/structures_MessageMedia.js.html
index a901041..bb184ed 100644
--- a/docs/structures_MessageMedia.js.html
+++ b/docs/structures_MessageMedia.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.2.0 » Source: structures/MessageMedia.js
+ whatsapp-web.js 1.2.1 » 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 4930749..488cf70 100644
--- a/docs/structures_PrivateChat.js.html
+++ b/docs/structures_PrivateChat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.2.0 » Source: structures/PrivateChat.js
+ whatsapp-web.js 1.2.1 » 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 199fb76..dee943f 100644
--- a/docs/structures_PrivateContact.js.html
+++ b/docs/structures_PrivateContact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.2.0 » Source: structures/PrivateContact.js
+ whatsapp-web.js 1.2.1 » 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 89e0de4..e4bc106 100644
--- a/docs/util_Constants.js.html
+++ b/docs/util_Constants.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.2.0 » Source: util/Constants.js
+ whatsapp-web.js 1.2.1 » 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 f5c9bad..22788f8 100644
--- a/docs/util_Util.js.html
+++ b/docs/util_Util.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.2.0 » Source: util/Util.js
+ whatsapp-web.js 1.2.1 » Source: util/Util.js
@@ -15,7 +15,7 @@
@@ -73,7 +73,7 @@ module.exports = Util;
diff --git a/package.json b/package.json
index dcdced2..b474f24 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "whatsapp-web.js",
- "version": "1.2.0-post",
+ "version": "1.2.1",
"description": "Library for interacting with the WhatsApp Web API ",
"main": "./index.js",
"scripts": {