mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 09:24:47 -04:00
Factor out notification logic.
This commit is contained in:
parent
ac2a177070
commit
20cf0b7aeb
3 changed files with 39 additions and 27 deletions
|
@ -212,22 +212,15 @@ function(matrixService, $rootScope, $q, $timeout, mPresence, notificationService
|
|||
roomTitle = event.room_id;
|
||||
}
|
||||
|
||||
var notification = new window.Notification(
|
||||
displayname +
|
||||
" (" + roomTitle + ")",
|
||||
{
|
||||
"body": message,
|
||||
"icon": member ? member.avatar_url : undefined
|
||||
});
|
||||
|
||||
notification.onclick = function() {
|
||||
console.log("notification.onclick() room=" + event.room_id);
|
||||
$rootScope.goToPage('room/' + (event.room_id));
|
||||
};
|
||||
|
||||
$timeout(function() {
|
||||
notification.close();
|
||||
}, 5 * 1000);
|
||||
notificationService.showNotification(
|
||||
displayname + " (" + roomTitle + ")",
|
||||
message,
|
||||
member ? member.avatar_url : undefined,
|
||||
function() {
|
||||
console.log("notification.onclick() room=" + event.room_id);
|
||||
$rootScope.goToPage('room/' + event.room_id);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue