diff -r 53ea7403c0a8 -r cb60ad01e2e8 libpurple/protocols/myspace/myspace.c --- a/libpurple/protocols/myspace/myspace.c Fri Dec 12 03:46:36 2008 +0000 +++ b/libpurple/protocols/myspace/myspace.c Fri Dec 12 04:01:39 2008 +0000 @@ -1018,7 +1018,6 @@ { MsimSession *session; MsimUser *user; - guint uid; gchar *user_to_lookup; MsimMessage *user_msg; @@ -1033,8 +1032,8 @@ user = msim_find_user(session, username); /* If is on buddy list, lookup by uid since it is faster. */ - if (user && (uid = purple_blist_node_get_int(&user->buddy->node, "UserID"))) { - user_to_lookup = g_strdup_printf("%d", uid); + if (user && user->id) { + user_to_lookup = g_strdup_printf("%d", user->id); } else { /* Looking up buddy not on blist. Lookup by whatever user entered. */ user_to_lookup = g_strdup(username); @@ -1970,10 +1969,11 @@ purple_blist_add_buddy(buddy, NULL, NULL, NULL); user = msim_get_user_from_buddy(buddy); - - /* All buddies on list should have a UserID integer associated with them. */ - purple_blist_node_set_int(&buddy->node, "UserID", msim_msg_get_integer(msg, "f")); - + user->id = msim_msg_get_integer(msg, "f"); + + /* Keep track of the user ID across sessions */ + purple_blist_node_set_int(&buddy->node, "UserID", user->id); + msim_store_user_info(session, msg, NULL); } else { purple_debug_info("msim", "msim_status: found buddy %s\n", username); @@ -2866,7 +2866,8 @@ /* 3. Update buddy information */ user = msim_get_user_from_buddy(buddy); - /* All buddies on list should have 'uid' integer associated with them. */ + user->id = uid; + /* Keep track of the user ID across sessions */ purple_blist_node_set_int(&buddy->node, "UserID", uid); /* Stores a few fields in the MsimUser, relevant to the buddy itself.