Move avatars into their own components so I can add functionality like custom default avatars and onerror sources without having to add it in 13 separate places. Add the aforementioned features.
This commit is contained in:
@@ -23,6 +23,9 @@ var TextForEvent = require("../../../../src/TextForEvent");
|
||||
var extend = require("../../../../src/extend");
|
||||
var dis = require("../../../../src/dispatcher");
|
||||
|
||||
var ComponentBroker = require("../../../../src/ComponentBroker");
|
||||
var MemberAvatar = ComponentBroker.get("atoms/MemberAvatar");
|
||||
|
||||
|
||||
var NotifierView = {
|
||||
notificationMessageForEvent: function(ev) {
|
||||
@@ -57,11 +60,13 @@ var NotifierView = {
|
||||
if (ev.getContent().body) msg = ev.getContent().body;
|
||||
}
|
||||
|
||||
var avatarUrlrl = MemberAvatar.avatarUrlForMember(ev.sender);
|
||||
|
||||
var notification = new global.Notification(
|
||||
title,
|
||||
{
|
||||
"body": msg,
|
||||
"icon": MatrixClientPeg.get().getAvatarUrlForMember(ev.sender)
|
||||
"icon": avatarUrl
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user