[gnome-shell] telepathyClient: insert a timestamp between log messages and pending messages



commit b2a2a00cd8284d3b422122252918714e05922000
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Mar 24 07:09:04 2011 -0400

    telepathyClient: insert a timestamp between log messages and pending messages
    
    This will give a visual break, giving a bit of clarity when a message
    is received from a new contact.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=645609

 js/ui/telepathyClient.js |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/telepathyClient.js b/js/ui/telepathyClient.js
index b59c058..675181a 100644
--- a/js/ui/telepathyClient.js
+++ b/js/ui/telepathyClient.js
@@ -249,6 +249,8 @@ Source.prototype = {
         let pendingTpMessages = this._channel.get_pending_messages();
         let pendingMessages = pendingTpMessages.map(function (tpMessage) { return makeMessageFromTpMessage(tpMessage, NotificationDirection.RECEIVED); });
 
+        let showTimestamp = false;
+
         for (let i = 0; i < logMessages.length; i++) {
             let logMessage = logMessages[i];
             let isPending = false;
@@ -262,17 +264,18 @@ Source.prototype = {
                 }
             }
 
-            if (!isPending)
+            if (!isPending) {
+                showTimestamp = true;
                 this._notification.appendMessage(logMessage, true);
+            }
         }
 
+        if (showTimestamp)
+            this._notification.appendTimestamp();
+
         for (let i = 0; i < pendingMessages.length; i++)
             this._notification.appendMessage(pendingMessages[i], true);
 
-        // Only show the timestamp if we have at least one message.
-        if (pendingMessages.length > 0 || logMessages.length > 0)
-            this._notification.appendTimestamp();
-
         if (pendingMessages.length > 0)
             this.notify();
     },



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]