diff options
author | Kegan Dougal <kegan@matrix.org> | 2014-10-31 11:54:04 +0000 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2014-10-31 11:54:04 +0000 |
commit | 20cf0b7aeb42c49bce199206130b5498b0fc293c (patch) | |
tree | f5fc222e4aaff780e570bbd2ac38d60246f769d0 /webclient/room/room-controller.js | |
parent | Add notification-service.js to handle binging/notifications. Shift logic to t... (diff) | |
download | synapse-20cf0b7aeb42c49bce199206130b5498b0fc293c.tar.xz |
Factor out notification logic.
Diffstat (limited to 'webclient/room/room-controller.js')
-rw-r--r-- | webclient/room/room-controller.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 2af1e8ae29..45638acaa6 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -201,16 +201,17 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) // Notify when a user joins if ((document.hidden || matrixService.presence.unavailable === mPresence.getState()) && event.state_key !== $scope.state.user_id && "join" === event.membership) { - var notification = new window.Notification( + + notificationService.showNotification( event.content.displayname + - " (" + (matrixService.getRoomIdToAliasMapping(event.room_id) || event.room_id) + ")", // FIXME: don't leak room_ids here - { - "body": event.content.displayname + " joined", - "icon": event.content.avatar_url ? event.content.avatar_url : undefined - }); - $timeout(function() { - notification.close(); - }, 5 * 1000); + " (" + (matrixService.getRoomIdToAliasMapping(event.room_id) || event.room_id) + ")", + event.content.displayname + " joined", + event.content.avatar_url ? event.content.avatar_url : undefined, + function() { + console.log("notification.onclick() room=" + event.room_id); + $rootScope.goToPage('room/' + event.room_id); + } + ); } } } |