summaryrefslogtreecommitdiff
path: root/protocols/VKontakte
diff options
context:
space:
mode:
authorElzorFox <elzorfox@ya.ru>2019-02-09 14:24:39 +0500
committerElzorFox <elzorfox@ya.ru>2019-02-09 14:26:21 +0500
commit227f5962e6803a253e49c147e77294782ff376ba (patch)
treea28ad85c881ef2e501452eb8da4a6bfbd6c54c52 /protocols/VKontakte
parentcf25657511e567a9ce2278661393aec73ae743b3 (diff)
VKontakte: fix error 13 in store procedure ‘GetServerHistory’
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r--protocols/VKontakte/src/vkjs.js30
1 files changed, 17 insertions, 13 deletions
diff --git a/protocols/VKontakte/src/vkjs.js b/protocols/VKontakte/src/vkjs.js
index 3f36975a65..e74f136363 100644
--- a/protocols/VKontakte/src/vkjs.js
+++ b/protocols/VKontakte/src/vkjs.js
@@ -83,21 +83,25 @@ while (ext != 0) {
} else
ext = 0;
};
-var ret = Hist.items.slice(0, index);
-var FMsgs = ret@.fwd_messages;
-var Idx = 0;
-var Uids = [];
-while (Idx < FMsgs.length) {
- var Jdx = 0;
- var CFMsgs = parseInt(FMsgs[Idx].length);
- while (Jdx < CFMsgs) {
- Uids.unshift(FMsgs[Idx][Jdx].user_id);
- Jdx = Jdx + 1;
+if (index > 0) {
+ var ret = Hist.items.slice(0, index);
+ var FMsgs = ret@.fwd_messages;
+ var Idx = 0;
+ var Uids = [];
+ while (Idx < FMsgs.length) {
+ var Jdx = 0;
+ var CFMsgs = parseInt(FMsgs[Idx].length);
+ while (Jdx < CFMsgs) {
+ Uids.unshift(FMsgs[Idx][Jdx].user_id);
+ Jdx = Jdx + 1;
+ };
+ Idx = Idx + 1;
};
- Idx = Idx + 1;
+ var FUsers = API.users.get({ "user_ids": Uids, "name_case": "gen" });
+ return { "count": index, "datetime": parseInt(Args.time), "items": ret, "fwd_users": FUsers, "once": parseInt(Args.once), "rcount": parseInt(Args.reqcount) };
+} else {
+ return{"count":0,"datetime":parseInt(Args.time),"items":[],"fwd_users":[],"once":parseInt(Args.once),"rcount":parseInt(Args.reqcount)};
};
-var FUsers = API.users.get({ "user_ids": Uids, "name_case": "gen" });
-return { "count": index, "datetime": parseInt(Args.time), "items": ret, "fwd_users": FUsers, "once": parseInt(Args.once), "rcount": parseInt(Args.reqcount) };
// Stored procedure name: GetServerHistory = End
// Stored procedure name: RetrieveMessagesByIds = Begin