summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikhail Zabaluev <mikhail.zabaluev@nokia.com>2010-11-03 16:49:35 +0200
committerMikhail Zabaluev <mikhail.zabaluev@nokia.com>2010-11-03 16:49:35 +0200
commit90c49625330dd1f2dfa0c075271490fa1cad9518 (patch)
tree71e7e131876990f953300257cad3f97e1fc0f04b /src
parent6b3085a3e3f0a310dc0625d8fd0e5b62241efd10 (diff)
Add the header "message-sent" to received messages in Chan.I.Messages
As retrieved from the Date header.
Diffstat (limited to 'src')
-rw-r--r--src/sip-text-channel.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sip-text-channel.c b/src/sip-text-channel.c
index 211f796..4027241 100644
--- a/src/sip-text-channel.c
+++ b/src/sip-text-channel.c
@@ -891,6 +891,7 @@ void tpsip_text_channel_receive(TpsipTextChannel *chan,
TpBaseConnection *base_conn;
sip_call_id_t *hdr_call_id;
sip_cseq_t *hdr_cseq;
+ sip_date_t *hdr_date_sent;
base_conn = (TpBaseConnection *) priv->conn;
msg = tp_message_new (base_conn, 2, 2);
@@ -902,6 +903,13 @@ void tpsip_text_channel_receive(TpsipTextChannel *chan,
sender);
tp_message_set_uint64 (msg, 0, "message-received", time (NULL));
+ hdr_date_sent = sip_date (sip);
+ if (hdr_date_sent != NULL)
+ {
+ tp_message_set_uint64 (msg, 0, "message-sent",
+ hdr_date_sent->d_time - SU_TIME_EPOCH);
+ }
+
/* Create a message token out of globally unique SIP header values.
* As MESSAGE requests can be sent within a dialog, we have to append
* the Call-ID value with the sequence number in CSeq. */