messageTray: Remove mute support
It was a nice feature, but with sources no longer being represented in the UI, there is no longer a way for users to make use of it. If we want to bring the feature back in the future, it would probably make more sense to implement via the chat source's policy anyway. https://bugzilla.gnome.org/show_bug.cgi?id=744850
This commit is contained in:
parent
485cd0f278
commit
b81be42d08
@ -1245,7 +1245,6 @@ const Source = new Lang.Class({
|
|||||||
this.iconName = iconName;
|
this.iconName = iconName;
|
||||||
|
|
||||||
this.isChat = false;
|
this.isChat = false;
|
||||||
this.isMuted = false;
|
|
||||||
|
|
||||||
this.notifications = [];
|
this.notifications = [];
|
||||||
|
|
||||||
@ -1286,13 +1285,6 @@ const Source = new Lang.Class({
|
|||||||
this.emit('title-changed');
|
this.emit('title-changed');
|
||||||
},
|
},
|
||||||
|
|
||||||
setMuted: function(muted) {
|
|
||||||
if (!this.isChat || this.isMuted == muted)
|
|
||||||
return;
|
|
||||||
this.isMuted = muted;
|
|
||||||
this.emit('muted-changed');
|
|
||||||
},
|
|
||||||
|
|
||||||
// Called to create a new icon actor.
|
// Called to create a new icon actor.
|
||||||
// Provides a sane default implementation, override if you need
|
// Provides a sane default implementation, override if you need
|
||||||
// something more fancy.
|
// something more fancy.
|
||||||
@ -1332,16 +1324,11 @@ const Source = new Lang.Class({
|
|||||||
notification.acknowledged = false;
|
notification.acknowledged = false;
|
||||||
this.pushNotification(notification);
|
this.pushNotification(notification);
|
||||||
|
|
||||||
if (!this.isMuted) {
|
|
||||||
// Play the sound now, if banners are disabled.
|
|
||||||
// Otherwise, it will be played when the notification
|
|
||||||
// is next shown.
|
|
||||||
if (this.policy.showBanners) {
|
if (this.policy.showBanners) {
|
||||||
this.emit('notify', notification);
|
this.emit('notify', notification);
|
||||||
} else {
|
} else {
|
||||||
notification.playSound();
|
notification.playSound();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
destroy: function(reason) {
|
destroy: function(reason) {
|
||||||
@ -1811,7 +1798,6 @@ const MessageTray = new Lang.Class({
|
|||||||
source: source,
|
source: source,
|
||||||
notifyId: 0,
|
notifyId: 0,
|
||||||
destroyId: 0,
|
destroyId: 0,
|
||||||
mutedChangedId: 0
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (source.isClearable)
|
if (source.isClearable)
|
||||||
@ -1821,13 +1807,6 @@ const MessageTray = new Lang.Class({
|
|||||||
|
|
||||||
obj.notifyId = source.connect('notify', Lang.bind(this, this._onNotify));
|
obj.notifyId = source.connect('notify', Lang.bind(this, this._onNotify));
|
||||||
obj.destroyId = source.connect('destroy', Lang.bind(this, this._onSourceDestroy));
|
obj.destroyId = source.connect('destroy', Lang.bind(this, this._onSourceDestroy));
|
||||||
obj.mutedChangedId = source.connect('muted-changed', Lang.bind(this,
|
|
||||||
function () {
|
|
||||||
if (source.isMuted)
|
|
||||||
this._notificationQueue = this._notificationQueue.filter(function(notification) {
|
|
||||||
return source != notification.source;
|
|
||||||
});
|
|
||||||
}));
|
|
||||||
|
|
||||||
this.emit('source-added', source);
|
this.emit('source-added', source);
|
||||||
|
|
||||||
@ -1843,7 +1822,6 @@ const MessageTray = new Lang.Class({
|
|||||||
|
|
||||||
source.disconnect(obj.notifyId);
|
source.disconnect(obj.notifyId);
|
||||||
source.disconnect(obj.destroyId);
|
source.disconnect(obj.destroyId);
|
||||||
source.disconnect(obj.mutedChangedId);
|
|
||||||
|
|
||||||
this.emit('source-removed', source);
|
this.emit('source-removed', source);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user