[gnome-shell] telepathyClient: Use sent timestamp instead of received timestamp
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] telepathyClient: Use sent timestamp instead of received timestamp
- Date: Wed, 24 Aug 2011 15:19:58 +0000 (UTC)
commit 712ea9b9b6876f74fec19b47551f674ac0f0f28a
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Aug 23 13:38:51 2011 -0400
telepathyClient: Use sent timestamp instead of received timestamp
It's generally more useful to see when a person sent a message instead of when
we received it. Also, a recent change in Telepathy made the received timestamp
be 0 for messages we send.
https://bugzilla.gnome.org/show_bug.cgi?id=640271
js/ui/telepathyClient.js | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/telepathyClient.js b/js/ui/telepathyClient.js
index de88c33..7650d24 100644
--- a/js/ui/telepathyClient.js
+++ b/js/ui/telepathyClient.js
@@ -44,11 +44,16 @@ let contactFeatures = [Tp.ContactFeature.ALIAS,
function makeMessageFromTpMessage(tpMessage, direction) {
let [text, flags] = tpMessage.to_text();
+
+ let timestamp = tpMessage.get_sent_timestamp();
+ if (timestamp == 0)
+ timestamp = tpMessage.get_received_timestamp();
+
return {
messageType: tpMessage.get_message_type(),
text: text,
sender: tpMessage.sender.alias,
- timestamp: tpMessage.get_received_timestamp(),
+ timestamp: timestamp,
direction: direction
};
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]