aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-06-28 17:14:01 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-06-28 17:14:01 +0800
commitc257cb2ca71d2b3eb48d2ba5b8311d9582019ad9 (patch)
tree8c6ff06293b8caa5a3281681972c7f89dec286fe
parenta7757678bf287ad748b097f9362f52d248afc6ca (diff)
downloadgsoc2013-empathy-c257cb2ca71d2b3eb48d2ba5b8311d9582019ad9.tar
gsoc2013-empathy-c257cb2ca71d2b3eb48d2ba5b8311d9582019ad9.tar.gz
gsoc2013-empathy-c257cb2ca71d2b3eb48d2ba5b8311d9582019ad9.tar.bz2
gsoc2013-empathy-c257cb2ca71d2b3eb48d2ba5b8311d9582019ad9.tar.lz
gsoc2013-empathy-c257cb2ca71d2b3eb48d2ba5b8311d9582019ad9.tar.xz
gsoc2013-empathy-c257cb2ca71d2b3eb48d2ba5b8311d9582019ad9.tar.zst
gsoc2013-empathy-c257cb2ca71d2b3eb48d2ba5b8311d9582019ad9.zip
Display the time when messages have been sent, not received (#653551)
Much more useful when receiving offline messages.
-rw-r--r--libempathy/empathy-message.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c
index f175a45d3..1c18cf53c 100644
--- a/libempathy/empathy-message.c
+++ b/libempathy/empathy-message.c
@@ -784,6 +784,7 @@ empathy_message_new_from_tp_message (TpMessage *tp_msg,
EmpathyMessage *message;
gchar *body;
TpChannelTextMessageFlags flags;
+ gint64 timestamp;
gint64 original_timestamp;
const GHashTable *part = tp_message_peek (tp_msg, 0);
@@ -791,6 +792,10 @@ empathy_message_new_from_tp_message (TpMessage *tp_msg,
body = tp_message_to_text (tp_msg, &flags);
+ timestamp = tp_message_get_sent_timestamp (tp_msg);
+ if (timestamp == 0)
+ timestamp = tp_message_get_received_timestamp (tp_msg);
+
original_timestamp = tp_asv_get_int64 (part,
"original-message-received", NULL);
@@ -799,7 +804,7 @@ empathy_message_new_from_tp_message (TpMessage *tp_msg,
"token", tp_message_get_token (tp_msg),
"supersedes", tp_message_get_supersedes (tp_msg),
"type", tp_message_get_message_type (tp_msg),
- "timestamp", tp_message_get_received_timestamp (tp_msg),
+ "timestamp", timestamp,
"original-timestamp", original_timestamp,
"flags", flags,
"is-backlog", flags & TP_CHANNEL_TEXT_MESSAGE_FLAG_SCROLLBACK,