Only start event streaming after having set up the controllers.

This commit is contained in:
Erik Johnston 2014-08-21 17:55:41 +01:00
parent 5670da1c1e
commit 2e1ab9db08
6 changed files with 19 additions and 5 deletions

View file

@ -15,7 +15,8 @@ for port in "8080" "8081" "8082"; do
-f "$DIR/$port.log" \
-d "$DIR/$port.db" \
-vv \
-D --pid-file "$DIR/$port.pid"
-D --pid-file "$DIR/$port.pid"\
-w
done
echo "Starting webclient on port 8000..."

View file

@ -53,7 +53,7 @@ angular.module('MatrixWebClientController', ['matrixService'])
};
if (matrixService.isUserLoggedIn()) {
eventStreamService.resume();
// eventStreamService.resume();
}
// Logs the user out

View file

@ -80,6 +80,6 @@ matrixWebClient.run(['$location', 'matrixService', 'eventStreamService', functio
$location.path("login");
}
else {
eventStreamService.resume();
// eventStreamService.resume();
}
}]);

View file

@ -106,6 +106,16 @@ angular.module('eventStreamService', [])
// FIXME: We are discarding all the messages.
matrixService.rooms().then(
function(response) {
var rooms = response.data.rooms;
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);
}
}
}
var presence = response.data.presence;
for (var i = 0; i < presence.length; ++i) {
eventHandlerService.handleEvent(presence[i], false);

View file

@ -328,6 +328,7 @@ angular.module('RoomController', ['ngSanitize', 'mUtilities'])
var chunk = response.data.chunk[i];
updateMemberList(chunk);
}
eventStreamService.resume();
},
function(error) {
$scope.feedback = "Failed get member list: " + error.data.error;

View file

@ -17,8 +17,8 @@ limitations under the License.
'use strict';
angular.module('RoomsController', ['matrixService', 'mFileInput', 'mFileUpload', 'eventHandlerService'])
.controller('RoomsController', ['$scope', '$location', 'matrixService', 'mFileUpload', 'eventHandlerService',
function($scope, $location, matrixService, mFileUpload, eventHandlerService) {
.controller('RoomsController', ['$scope', '$location', 'matrixService', 'mFileUpload', 'eventHandlerService', 'eventStreamService',
function($scope, $location, matrixService, mFileUpload, eventHandlerService, eventStreamService) {
$scope.rooms = {};
$scope.public_rooms = [];
@ -113,6 +113,8 @@ angular.module('RoomsController', ['matrixService', 'mFileInput', 'mFileUpload',
$scope.public_rooms = assignRoomAliases(response.data.chunk);
}
);
eventStreamService.resume();
};
$scope.createNewRoom = function(room_id, isPrivate) {