From 06c79a23d481c45574915fe5ae7088f156e533b3 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 28 Aug 2014 15:56:16 +0200 Subject: [PATCH] BF: Made member events parsing work (handleEvents expects an array of events) --- webclient/components/matrix/event-stream-service.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/webclient/components/matrix/event-stream-service.js b/webclient/components/matrix/event-stream-service.js index a1a98b2a3..dc2e359dd 100644 --- a/webclient/components/matrix/event-stream-service.js +++ b/webclient/components/matrix/event-stream-service.js @@ -96,7 +96,7 @@ angular.module('eventStreamService', []) ); return deferred.promise; - } + }; var startEventStream = function() { settings.shouldPoll = true; @@ -110,18 +110,14 @@ angular.module('eventStreamService', []) for (var i = 0; i < rooms.length; ++i) { var room = rooms[i]; if ("state" in room) { - for (var j = 0; j < room.state.length; ++j) { - eventHandlerService.handleEvents(room.state[j], false); - } + eventHandlerService.handleEvents(room.state, false); } } var presence = response.data.presence; - for (var i = 0; i < presence.length; ++i) { - eventHandlerService.handleEvent(presence[i], false); - } + eventHandlerService.handleEvents(presence, false); - settings.from = response.data.end + settings.from = response.data.end; doEventStream(deferred); }, function(error) {