comparison libpurple/protocols/myspace/myspace.c @ 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 11c727b19201
children d6802883e96e
comparison
equal deleted inserted replaced
19565:4691b5f80ac8 19570:94a2a1ccd6ec
681 */ 681 */
682 static gboolean 682 static gboolean
683 msim_incoming_im(MsimSession *session, MsimMessage *msg) 683 msim_incoming_im(MsimSession *session, MsimMessage *msg)
684 { 684 {
685 gchar *username, *msg_msim_markup, *msg_purple_markup; 685 gchar *username, *msg_msim_markup, *msg_purple_markup;
686 time_t time_received;
686 687
687 g_return_val_if_fail(MSIM_SESSION_VALID(session), FALSE); 688 g_return_val_if_fail(MSIM_SESSION_VALID(session), FALSE);
688 g_return_val_if_fail(msg != NULL, FALSE); 689 g_return_val_if_fail(msg != NULL, FALSE);
689 690
690 username = msim_msg_get_string(msg, "_username"); 691 username = msim_msg_get_string(msg, "_username");
694 g_return_val_if_fail(msg_msim_markup != NULL, FALSE); 695 g_return_val_if_fail(msg_msim_markup != NULL, FALSE);
695 696
696 msg_purple_markup = msim_markup_to_html(session, msg_msim_markup); 697 msg_purple_markup = msim_markup_to_html(session, msg_msim_markup);
697 g_free(msg_msim_markup); 698 g_free(msg_msim_markup);
698 699
699 serv_got_im(session->gc, username, msg_purple_markup, 700 time_received = msim_msg_get_integer(msg, "date");
700 PURPLE_MESSAGE_RECV, time(NULL)); 701 if (!time_received) {
702 time_received = time(NULL);
703 }
704
705 serv_got_im(session->gc, username, msg_purple_markup, PURPLE_MESSAGE_RECV, time_received);
701 706
702 g_free(username); 707 g_free(username);
703 g_free(msg_purple_markup); 708 g_free(msg_purple_markup);
704 709
705 return TRUE; 710 return TRUE;