# HG changeset patch # User Mark Doliner # Date 1226603479 0 # Node ID 9d2ae363907901a098e45ec28178d033b3b98a8d # Parent 1406a2fa649d9abc294df9a3b11078e11b80e484# Parent e71c1fad229f234918483fe6b22284ff70f76b19 merge of 'b1b60077658bb1e01f71e81175786a8e7c3c4916' and 'd74085222c90ffa62b79ed27984dded8a8725c00' diff -r e71c1fad229f -r 9d2ae3639079 libpurple/dbus-analyze-functions.py --- a/libpurple/dbus-analyze-functions.py Thu Nov 13 09:19:17 2008 +0000 +++ b/libpurple/dbus-analyze-functions.py Thu Nov 13 19:11:19 2008 +0000 @@ -372,13 +372,13 @@ def inputsimple(self, type, name, us): if us: + self.cdecls.append("\tdbus_uint32_t %s;" % name) + self.cparams.append(("UINT32", name)) + self.addintype("u", name) + else: self.cdecls.append("\tdbus_int32_t %s;" % name) self.cparams.append(("INT32", name)) self.addintype("i", name) - else: - self.cdecls.append("\tdbus_uint32_t %s;" % name) - self.cparams.append(("UINT32", name)) - self.addintype("u", name) def inputstring(self, type, name, us): if us: diff -r e71c1fad229f -r 9d2ae3639079 libpurple/protocols/myspace/myspace.c --- a/libpurple/protocols/myspace/myspace.c Thu Nov 13 09:19:17 2008 +0000 +++ b/libpurple/protocols/myspace/myspace.c Thu Nov 13 19:11:19 2008 +0000 @@ -680,20 +680,34 @@ msim_incoming_im(MsimSession *session, MsimMessage *msg) { gchar *username, *msg_msim_markup, *msg_purple_markup; + gchar *userid; time_t time_received; + PurpleConversation *conv; g_return_val_if_fail(MSIM_SESSION_VALID(session), FALSE); g_return_val_if_fail(msg != NULL, FALSE); username = msim_msg_get_string(msg, "_username"); + /* I know this isn't really a string... but we need it to be one for + * purple_find_conversation_with_account(). */ + userid = msim_msg_get_string(msg, "f"); g_return_val_if_fail(username != NULL, FALSE); + purple_debug_info("msim_incoming_im", "UserID is %s", userid); + if (msim_is_userid(username)) { purple_debug_info("msim", "Ignoring message from spambot (%s) on account %s\n", username, purple_account_get_username(session->account)); g_free(username); return FALSE; } + + /* See if a conversation with their UID already exists...*/ + conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, userid, session->account); + if (conv) { + /* Since the conversation exists... We need to normalize it */ + purple_conversation_set_name(conv, username); + } msg_msim_markup = msim_msg_get_string(msg, "msg"); g_return_val_if_fail(msg_msim_markup != NULL, FALSE); @@ -703,6 +717,7 @@ time_received = msim_msg_get_integer(msg, "date"); if (!time_received) { + purple_debug_info("msim_incoming_im", "date in message not set.\n"); time_received = time(NULL); } diff -r e71c1fad229f -r 9d2ae3639079 libpurple/protocols/myspace/myspace.h --- a/libpurple/protocols/myspace/myspace.h Thu Nov 13 09:19:17 2008 +0000 +++ b/libpurple/protocols/myspace/myspace.h Thu Nov 13 19:11:19 2008 +0000 @@ -48,6 +48,7 @@ #include "request.h" /* For dialogs used in setting the username */ #include "xmlnode.h" #include "core.h" +#include "conversation.h" /* For late normalization */ /* MySpaceIM includes */ #include "persist.h"