Turn RoomInviteSource to a more generic source
All the approving source will be basically the same. https://bugzilla.gnome.org/show_bug.cgi?id=653939
This commit is contained in:
parent
fe82897064
commit
90db743cc9
@ -216,7 +216,10 @@ Client.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We got the TpContact
|
// We got the TpContact
|
||||||
let source = new RoomInviteSource(dispatchOp);
|
|
||||||
|
// FIXME: We don't have a 'chat room' icon (bgo #653737) use
|
||||||
|
// system-users for now as Empathy does.
|
||||||
|
let source = new ApproverSource(dispatchOp, _("Invitation"), 'system-users');
|
||||||
Main.messageTray.add(source);
|
Main.messageTray.add(source);
|
||||||
|
|
||||||
let notif = new RoomInviteNotification(source, dispatchOp, channel, contacts[0]);
|
let notif = new RoomInviteNotification(source, dispatchOp, channel, contacts[0]);
|
||||||
@ -800,16 +803,17 @@ ChatNotification.prototype = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function RoomInviteSource(dispatchOp) {
|
function ApproverSource(dispatchOp, text, icon) {
|
||||||
this._init(dispatchOp);
|
this._init(dispatchOp, text, icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
RoomInviteSource.prototype = {
|
ApproverSource.prototype = {
|
||||||
__proto__: MessageTray.Source.prototype,
|
__proto__: MessageTray.Source.prototype,
|
||||||
|
|
||||||
_init: function(dispatchOp) {
|
_init: function(dispatchOp, text, icon) {
|
||||||
MessageTray.Source.prototype._init.call(this, _("Invitation"));
|
MessageTray.Source.prototype._init.call(this, text);
|
||||||
|
|
||||||
|
this._icon = icon;
|
||||||
this._setSummaryIcon(this.createNotificationIcon());
|
this._setSummaryIcon(this.createNotificationIcon());
|
||||||
|
|
||||||
this._dispatchOp = dispatchOp;
|
this._dispatchOp = dispatchOp;
|
||||||
@ -832,9 +836,7 @@ RoomInviteSource.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
createNotificationIcon: function() {
|
createNotificationIcon: function() {
|
||||||
// FIXME: We don't have a 'chat room' icon (bgo #653737) use
|
return new St.Icon({ icon_name: this._icon,
|
||||||
// system-users for now as Empathy does.
|
|
||||||
return new St.Icon({ icon_name: 'system-users',
|
|
||||||
icon_type: St.IconType.FULLCOLOR,
|
icon_type: St.IconType.FULLCOLOR,
|
||||||
icon_size: this.ICON_SIZE });
|
icon_size: this.ICON_SIZE });
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user