changeset 19570:94a2a1ccd6ec

Use the sent timestamp in incoming instant messages instead of the current time, if available. This means that offline messages sent in the past now show correctly that they were. Closes #2906.
author Jeffrey Connelly <jaconnel@calpoly.edu>
date Sun, 02 Sep 2007 02:27:12 +0000
parents 4691b5f80ac8
children de0ae9a3eee2 d6802883e96e
files libpurple/protocols/myspace/myspace.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/myspace/myspace.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Sun Sep 02 02:27:12 2007 +0000
@@ -683,6 +683,7 @@
 msim_incoming_im(MsimSession *session, MsimMessage *msg)
 {
 	gchar *username, *msg_msim_markup, *msg_purple_markup;
+	time_t time_received;
 
 	g_return_val_if_fail(MSIM_SESSION_VALID(session), FALSE);
 	g_return_val_if_fail(msg != NULL, FALSE);
@@ -696,8 +697,12 @@
 	msg_purple_markup = msim_markup_to_html(session, msg_msim_markup);
 	g_free(msg_msim_markup);
 
-	serv_got_im(session->gc, username, msg_purple_markup, 
-			PURPLE_MESSAGE_RECV, time(NULL));
+	time_received = msim_msg_get_integer(msg, "date");
+	if (!time_received) {
+		time_received = time(NULL);
+	}
+
+	serv_got_im(session->gc, username, msg_purple_markup, PURPLE_MESSAGE_RECV, time_received);
 
 	g_free(username);
 	g_free(msg_purple_markup);