[gnome-shell] telepathyClient: Check for a no-op before pushing an alias change message
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] telepathyClient: Check for a no-op before pushing an alias change message
- Date: Wed, 5 Oct 2011 19:34:57 +0000 (UTC)
commit d862c0879b1fe3dffaa2a993340dd42c216b31b4
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Oct 3 14:48:49 2011 -0400
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
js/ui/telepathyClient.js | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/telepathyClient.js b/js/ui/telepathyClient.js
index 0ea3a7e..a0a5823 100644
--- a/js/ui/telepathyClient.js
+++ b/js/ui/telepathyClient.js
@@ -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() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]