Skip to content
Snippets Groups Projects
Commit 74c90f78 authored by Erik Johnston's avatar Erik Johnston
Browse files

Reinitialize room when creating a RoomController so that we start off with a...

Reinitialize room when creating a RoomController so that we start off with a clean slate, as it expects/
parent dde50d42
No related branches found
No related tags found
No related merge requests found
......@@ -44,6 +44,12 @@ angular.module('eventHandlerService', [])
$rootScope.events.rooms[room_id].members = {};
}
}
var reInitRoom = function(room_id) {
$rootScope.events.rooms[room_id] = {};
$rootScope.events.rooms[room_id].messages = [];
$rootScope.events.rooms[room_id].members = {};
}
var handleMessage = function(event, isLiveEvent) {
if ("membership_target" in event.content) {
......@@ -118,6 +124,10 @@ angular.module('eventHandlerService', [])
for (var i=0; i<events.length; i++) {
this.handleEvent(events[i], isLiveEvents);
}
}
},
reInitRoom: function(room_id) {
reInitRoom(room_id);
},
};
}]);
......@@ -316,6 +316,8 @@ angular.module('RoomController', ['ngSanitize', 'mUtilities'])
};
var onInit2 = function() {
eventHandlerService.reInitRoom($scope.room_id);
// Join the room
matrixService.join($scope.room_id).then(
function() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment