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:
parent
b580fba7db
commit
fec266f1c0
20 changed files with 314 additions and 23 deletions
|
@ -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
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue