telepathyClient: Check for a no-op before pushing an alias change message

tp-glib can sometimes emit a notify::alias signal when the alias doesn't
actually change. Bail out early instead of pushing an alias change message.

https://bugzilla.gnome.org/show_bug.cgi?id=660774
This commit is contained in:
Jasper St. Pierre 2011-10-03 14:48:49 -04:00
parent 23a4d4c69e
commit d862c0879b

View File

@ -539,9 +539,13 @@ ChatSource.prototype = {
_updateAlias: function() {
let oldAlias = this.title;
this.setTitle(this._contact.get_alias());
this._notification.appendAliasChange(oldAlias, this.title);
this.pushNotification(this._notification);
let newAlias = this._contact.get_alias();
if (oldAlias == newAlias)
return;
this.setTitle(newAlias);
this._notification.appendAliasChange(oldAlias, newAlias);
},
createNotificationIcon: function() {