diff options
author | mrDoctorWho <mrdoctorwho@gmail.com> | 2014-08-11 23:38:49 +0400 |
---|---|---|
committer | mrDoctorWho <mrdoctorwho@gmail.com> | 2014-08-11 23:38:49 +0400 |
commit | fe7335e6f112711071290ace677491c250ea7f20 (patch) | |
tree | c6075ea4095f4386af85661162bbea3c61d63c8b /js | |
parent | 7945dafd82660db0a61a33c293094c6366cde2e1 (diff) |
A huge refactoring just happened to transport.
Deleted all handlers and now they're separately stored in the modules directory
Added js sources which transport uses instead of local handling
Fixed couple typos in translations
Forward messages now have things called "spacers" in start of line
Users is now handling in separate threads
And there are more changes...
Diffstat (limited to 'js')
-rw-r--r-- | js/getChats.js | 13 | ||||
-rw-r--r-- | js/getLastTime.js | 3 | ||||
-rw-r--r-- | js/getPhotos.js | 17 |
3 files changed, 33 insertions, 0 deletions
diff --git a/js/getChats.js b/js/getChats.js new file mode 100644 index 0000000..d9f29c2 --- /dev/null +++ b/js/getChats.js @@ -0,0 +1,13 @@ +var dialogs = API.messages.searchDialogs({"limit":200}); +var len = dialogs.length; +var chats = []; +while (len >= 0) { + var dialog = dialogs[len]; + if (dialog.type) { + if (dialog.type == "chat") { + chats.push(dialog); + } + } + len = len - 1; +} +return chats; diff --git a/js/getLastTime.js b/js/getLastTime.js new file mode 100644 index 0000000..c621cb5 --- /dev/null +++ b/js/getLastTime.js @@ -0,0 +1,3 @@ +var uid = Args.uid; +var time = API.messages.getLastActivity({"user_id": uid}); +return time.time; diff --git a/js/getPhotos.js b/js/getPhotos.js new file mode 100644 index 0000000..5b2b5dd --- /dev/null +++ b/js/getPhotos.js @@ -0,0 +1,17 @@ +var users = Args.users; +var photoSize = Args.size; +var data = API.users.get({"user_ids":users, fields:[photoSize]}); +var len = data.length; +var photos = {}; + +while (len >= 0) { + var thisone = data[len]; + if (thisone.uid) { + var id = thisone["uid"]; + var size = thisone[photoSize]; + photos.push({"uid": id, "photo":size}); + + } + len = len - 1; +} +return photos; |