telepathyClient: Stop displaying presence in notification
The presence indicator in notification uses API only needed for the telepathyClient, since it's a complete fringe feature nowadays it's not worth maintaining specific API for it. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3103>
This commit is contained in:
parent
739725e521
commit
5f7e8d292d
@ -332,8 +332,7 @@ class ChatSource extends MessageTray.Source {
|
||||
|
||||
this._contact.connectObject(
|
||||
'notify::alias', this._updateAlias.bind(this),
|
||||
'notify::avatar-file', this._updateAvatarIcon.bind(this),
|
||||
'presence-changed', this._presenceChanged.bind(this), this);
|
||||
'notify::avatar-file', this._updateAvatarIcon.bind(this), this);
|
||||
|
||||
// Add ourselves as a source.
|
||||
Main.messageTray.add(this);
|
||||
@ -393,35 +392,6 @@ class ChatSource extends MessageTray.Source {
|
||||
return new Gio.ThemedIcon({name: 'avatar-default'});
|
||||
}
|
||||
|
||||
getSecondaryIcon() {
|
||||
let iconName;
|
||||
let presenceType = this._contact.get_presence_type();
|
||||
|
||||
switch (presenceType) {
|
||||
case Tp.ConnectionPresenceType.AVAILABLE:
|
||||
iconName = 'user-available';
|
||||
break;
|
||||
case Tp.ConnectionPresenceType.BUSY:
|
||||
iconName = 'user-busy';
|
||||
break;
|
||||
case Tp.ConnectionPresenceType.OFFLINE:
|
||||
iconName = 'user-offline';
|
||||
break;
|
||||
case Tp.ConnectionPresenceType.HIDDEN:
|
||||
iconName = 'user-invisible';
|
||||
break;
|
||||
case Tp.ConnectionPresenceType.AWAY:
|
||||
iconName = 'user-away';
|
||||
break;
|
||||
case Tp.ConnectionPresenceType.EXTENDED_AWAY:
|
||||
iconName = 'user-idle';
|
||||
break;
|
||||
default:
|
||||
iconName = 'user-offline';
|
||||
}
|
||||
return new Gio.ThemedIcon({name: iconName});
|
||||
}
|
||||
|
||||
_updateAvatarIcon() {
|
||||
this.iconUpdated();
|
||||
if (this._notification) {
|
||||
@ -630,15 +600,6 @@ class ChatSource extends MessageTray.Source {
|
||||
}
|
||||
}
|
||||
|
||||
_presenceChanged(_contact, _presence, _status, _message) {
|
||||
if (this._notification) {
|
||||
this._notification.update(
|
||||
this._notification.title,
|
||||
this._notification.bannerBodyText,
|
||||
{secondaryGIcon: this.getSecondaryIcon()});
|
||||
}
|
||||
}
|
||||
|
||||
_pendingRemoved(channel, message) {
|
||||
let idx = this._pendingMessages.indexOf(message);
|
||||
|
||||
@ -674,9 +635,8 @@ const ChatNotification = HAVE_TP ? GObject.registerClass({
|
||||
'timestamp-changed': {param_types: [ChatNotificationMessage.$gtype]},
|
||||
},
|
||||
}, class ChatNotification extends MessageTray.Notification {
|
||||
_init(source) {
|
||||
super._init(source, source.title, null,
|
||||
{secondaryGIcon: source.getSecondaryIcon()});
|
||||
constructor(source) {
|
||||
super(source, source.title, null, null);
|
||||
this.setUrgency(MessageTray.Urgency.HIGH);
|
||||
this.setResident(true);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user