mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 12:44:58 -04:00
Handle "m.room.create" in order to inform controllers about new rooms
This commit is contained in:
parent
aa337f588c
commit
d5da6b0cef
3 changed files with 29 additions and 5 deletions
|
@ -17,8 +17,8 @@ limitations under the License.
|
|||
'use strict';
|
||||
|
||||
angular.module('HomeController', ['matrixService', 'eventHandlerService', 'RecentsController'])
|
||||
.controller('HomeController', ['$scope', '$location', 'matrixService',
|
||||
function($scope, $location, matrixService) {
|
||||
.controller('HomeController', ['$scope', '$location', 'matrixService', 'eventHandlerService',
|
||||
function($scope, $location, matrixService, eventHandlerService) {
|
||||
|
||||
$scope.config = matrixService.config();
|
||||
$scope.public_rooms = [];
|
||||
|
@ -72,7 +72,6 @@ angular.module('HomeController', ['matrixService', 'eventHandlerService', 'Recen
|
|||
response.data.room_id);
|
||||
matrixService.createRoomIdToAliasMapping(
|
||||
response.data.room_id, response.data.room_alias);
|
||||
refresh();
|
||||
},
|
||||
function(error) {
|
||||
$scope.feedback = "Failure: " + error.data;
|
||||
|
@ -133,6 +132,14 @@ angular.module('HomeController', ['matrixService', 'eventHandlerService', 'Recen
|
|||
}
|
||||
);
|
||||
|
||||
// Listen to room creation event in order to update the public rooms list
|
||||
$scope.$on(eventHandlerService.ROOM_CREATE_EVENT, function(ngEvent, event, isLive) {
|
||||
if (isLive) {
|
||||
// As we do not know if this room is public, do a full list refresh
|
||||
refresh();
|
||||
}
|
||||
});
|
||||
|
||||
refresh();
|
||||
};
|
||||
}]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue