summary refs log tree commit diff
path: root/webclient
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-08-27 10:24:01 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-08-27 15:55:51 +0200
commite40d82936359337cecdfc73a3b09cc089f75071b (patch)
treeb2e01912e3e264a6fe20bf505912d51a49ff6eb7 /webclient
parentRenamed /ds to /directory (diff)
downloadsynapse-e40d82936359337cecdfc73a3b09cc089f75071b.tar.xz
Support limit and feedback param of initialSync
Diffstat (limited to '')
-rw-r--r--webclient/components/matrix/matrix-service.js13
-rw-r--r--webclient/home/home-controller.js5
2 files changed, 15 insertions, 3 deletions
diff --git a/webclient/components/matrix/matrix-service.js b/webclient/components/matrix/matrix-service.js
index 93e23de68c..c63e55bb07 100644
--- a/webclient/components/matrix/matrix-service.js
+++ b/webclient/components/matrix/matrix-service.js
@@ -106,11 +106,20 @@ angular.module('matrixService', [])
         },
 
         // List all rooms joined or been invited to
-        rooms: function(from, to, limit) {
+        rooms: function(limit, feedback) {
             // The REST path spec
+
             var path = "/initialSync";
 
-            return doRequest("GET", path);
+            var params = {};
+            if (limit) {
+                params.limit = limit;
+            }
+            if (feedback) {
+                params.feedback = feedback;
+            }
+
+            return doRequest("GET", path, params);
         },
 
         // Joins a room
diff --git a/webclient/home/home-controller.js b/webclient/home/home-controller.js
index 867ae522a6..3be7fca909 100644
--- a/webclient/home/home-controller.js
+++ b/webclient/home/home-controller.js
@@ -78,12 +78,15 @@ angular.module('HomeController', ['matrixService', 'mFileInput', 'mFileUpload',
 
     var refresh = function() {
         // List all rooms joined or been invited to
-        matrixService.rooms(1,true).then(
+        matrixService.rooms(1, false).then(
             function(response) {
                 var data = assignRoomAliases(response.data.rooms);
                 $scope.feedback = "Success";
                 for (var i=0; i<data.length; i++) {
                     $scope.rooms[data[i].room_id] = data[i];
+
+                    // Create a shortcut for the last message of this room
+                    $scope.rooms[data[i].room_id].lastMsg = data[i].messages.chunk[0];
                 }
 
                 var presence = response.data.presence;