diff options
author | John Smith <mrdoctorwho@gmail.com> | 2018-07-10 12:07:37 +0300 |
---|---|---|
committer | John Smith <mrdoctorwho@gmail.com> | 2018-07-10 12:07:37 +0300 |
commit | 55826a3503bf6ad5f70574a3125a34999ef0bb2d (patch) | |
tree | 3fc2a680759fe6d0846961c1f4f294fe02371b23 /js | |
parent | a230674edd7c730b70e6441d0205c0dcb4255781 (diff) |
attempt to fix offline message reception; add getMessagesBulk method code
Diffstat (limited to 'js')
-rw-r--r-- | js/getMessagesBulk.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/js/getMessagesBulk.js b/js/getMessagesBulk.js new file mode 100644 index 0000000..b1aaac1 --- /dev/null +++ b/js/getMessagesBulk.js @@ -0,0 +1,14 @@ +var users = Args.users.split(","); +var startMessageId = Args.start_message_id; +if (startMessageId == null) { + startMessageId = 0; +} +var history = []; +var length = users.length; +while (length > 0) { + var uid = users[length - 1]; + var userHistory = API.messages.getHistory({"user_id": uid, "start_message_id": startMessageId}); + history.push(userHistory); + length = length - 1; +} +return history;
\ No newline at end of file |