From b2a2a00cd8284d3b422122252918714e05922000 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 24 Mar 2011 07:09:04 -0400 Subject: [PATCH] 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 file changed, 8 insertions(+), 5 deletions(-) diff --git a/js/ui/telepathyClient.js b/js/ui/telepathyClient.js index b59c0581c..675181a26 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(); },