summary refs log tree commit diff
path: root/webclient/components
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-08-14 17:23:47 +0100
committerKegan Dougal <kegan@matrix.org>2014-08-14 17:23:47 +0100
commit30da8c81c761a1f58c9643f41450240bfe1d6cc5 (patch)
tree506f0f8791fe2f1ecf9ce498058bbded336596ad /webclient/components
parentPass back the user_id in the response to /login in case it has changed. Store... (diff)
downloadsynapse-30da8c81c761a1f58c9643f41450240bfe1d6cc5.tar.xz
webclient: You can now paginate in rooms. Defaults to 10 messages, with a button to get more (needs to be hooked into infini-scrolling).
Diffstat (limited to 'webclient/components')
-rw-r--r--webclient/components/matrix/matrix-service.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/webclient/components/matrix/matrix-service.js b/webclient/components/matrix/matrix-service.js
index 132c996f7a..6d66111469 100644
--- a/webclient/components/matrix/matrix-service.js
+++ b/webclient/components/matrix/matrix-service.js
@@ -212,6 +212,17 @@ angular.module('matrixService', [])
             path = path.replace("$room_id", room_id);
             return doRequest("GET", path);
         },
+        
+        paginateBackMessages: function(room_id, from_token, limit) {
+            var path = "/rooms/$room_id/messages/list";
+            path = path.replace("$room_id", room_id);
+            var params = {
+                from: from_token,
+                to: "START",
+                limit: limit
+            };
+            return doRequest("GET", path, params);
+        },
 
         // get a list of public rooms on your home server
         publicRooms: function() {