diff options
author | Kegan Dougal <kegan@matrix.org> | 2014-11-14 15:57:18 +0000 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2014-11-14 15:57:18 +0000 |
commit | 78bf5648e79b9a1f94f4b52e9c37227b79a899b2 (patch) | |
tree | b03131865580113d3c5f07f1c8524c91e0dd3769 /syweb/webclient | |
parent | Tidy up room.html member list to use member again, now that scope.members is ... (diff) | |
download | synapse-78bf5648e79b9a1f94f4b52e9c37227b79a899b2.tar.xz |
Fix bug which caused notifications to appear for old messages.
Diffstat (limited to 'syweb/webclient')
-rw-r--r-- | syweb/webclient/components/matrix/event-handler-service.js | 4 | ||||
-rw-r--r-- | syweb/webclient/room/room-controller.js | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/syweb/webclient/components/matrix/event-handler-service.js b/syweb/webclient/components/matrix/event-handler-service.js index efe7bf234c..e9540bd5c0 100644 --- a/syweb/webclient/components/matrix/event-handler-service.js +++ b/syweb/webclient/components/matrix/event-handler-service.js @@ -188,7 +188,9 @@ function(matrixService, $rootScope, $q, $timeout, $filter, mPresence, notificati if (event.user_id !== matrixService.config().user_id) { room.addMessageEvent(event, !isLiveEvent); - displayNotification(event); + if (isLiveEvent) { + displayNotification(event); + } } else { // we may have locally echoed this, so we should replace the event diff --git a/syweb/webclient/room/room-controller.js b/syweb/webclient/room/room-controller.js index f6a1eea70a..afa029117b 100644 --- a/syweb/webclient/room/room-controller.js +++ b/syweb/webclient/room/room-controller.js @@ -339,25 +339,24 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput', 'a } }; + // Tries to find a suitable room ID for this room. $scope.onInit = function() { console.log("onInit"); - // Does the room ID provided in the URL? + // Try to find out the room ID to load. var room_id_or_alias; - if ($routeParams.room_id_or_alias) { + if ($routeParams.room_id_or_alias) { // provided in the url room_id_or_alias = decodeURIComponent($routeParams.room_id_or_alias); } if (room_id_or_alias && '!' === room_id_or_alias[0]) { - // Yes. We can go on right now + // it's a room ID since they start with ! $scope.room_id = room_id_or_alias; $scope.room_alias = modelService.getRoomIdToAliasMapping($scope.room_id); onInit2(); } else { - // No. The URL contains the room alias. Get this alias. - if (room_id_or_alias) { - // The room alias was passed urlencoded, use it as is + if (room_id_or_alias && '#' === room_id_or_alias[0]) { $scope.room_alias = room_id_or_alias; } else { @@ -392,7 +391,6 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput', 'a }; var onInit2 = function() { - console.log("onInit2"); $scope.room = modelService.getRoom($scope.room_id); // Scroll down as soon as possible so that we point to the last message @@ -402,7 +400,7 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput', 'a // Make sure the initialSync has been before going further eventHandlerService.waitForInitialSyncCompletion().then( function() { - + console.log("initialSync is complete."); var needsToJoin = true; // The room members is available in the data fetched by initialSync |