[empathy] Display the time when messages have been sent, not received (#653551)
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] Display the time when messages have been sent, not received (#653551)
- Date: Tue, 28 Jun 2011 13:45:35 +0000 (UTC)
commit c257cb2ca71d2b3eb48d2ba5b8311d9582019ad9
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Tue Jun 28 11:14:01 2011 +0200
Display the time when messages have been sent, not received (#653551)
Much more useful when receiving offline messages.
libempathy/empathy-message.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c
index f175a45..1c18cf5 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]