[gnome-shell] telepathyClient: reset badge as soon as the summary notification is shown
- From: Marina Zhurakhinskaya <marinaz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] telepathyClient: reset badge as soon as the summary notification is shown
- Date: Fri, 9 Dec 2011 16:49:35 +0000 (UTC)
commit efe6d06dddc5b157eb9b90cc93cf81408dac45eb
Author: Marina Zhurakhinskaya <marinaz redhat com>
Date: Thu Dec 8 18:35:19 2011 -0500
telepathyClient: reset badge as soon as the summary notification is shown
That way the user will not see an outdated pending messages count while
they are viewing them or chatting with the sender.
https://bugzilla.gnome.org/show_bug.cgi?id=659272
js/ui/telepathyClient.js | 30 +++---------------------------
1 files changed, 3 insertions(+), 27 deletions(-)
---
diff --git a/js/ui/telepathyClient.js b/js/ui/telepathyClient.js
index 08d6c8c..9f9d12e 100644
--- a/js/ui/telepathyClient.js
+++ b/js/ui/telepathyClient.js
@@ -502,15 +502,9 @@ const ChatSource = new Lang.Class({
this._notification.setUrgency(MessageTray.Urgency.HIGH);
this._notifyTimeoutId = 0;
- // We ack messages when the message box is collapsed if user has
- // interacted with it before and so read the messages:
- // - user clicked on it the tray
- // - user expanded the notification by hovering over the toaster notification
- this._shouldAck = false;
-
- this.connect('summary-item-clicked', Lang.bind(this, this._summaryItemClicked));
- this._notification.connect('expanded', Lang.bind(this, this._notificationExpanded));
- this._notification.connect('collapsed', Lang.bind(this, this._notificationCollapsed));
+ // We ack messages when the user expands the new notification or views the summary
+ // notification, in which case the notification is also expanded.
+ this._notification.connect('expanded', Lang.bind(this, this._ackMessages));
this._presence = contact.get_presence_type();
@@ -774,24 +768,6 @@ const ChatSource = new Lang.Class({
// 'pending-message-removed' for each one.
this._channel.ack_all_pending_messages_async(Lang.bind(this, function(src, result) {
this._channel.ack_all_pending_messages_finish(result);}));
- },
-
- _summaryItemClicked: function(source, button) {
- if (button != 1)
- return;
-
- this._shouldAck = true;
- },
-
- _notificationExpanded: function() {
- this._shouldAck = true;
- },
-
- _notificationCollapsed: function() {
- if (this._shouldAck)
- this._ackMessages();
-
- this._shouldAck = false;
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]