diff libpurple/protocols/myspace/myspace.c @ 25382:c0b42d6c2785

propagate from branch 'im.pidgin.pidgin' (head f018e11a7ea08e07f22667e6daca2ec7e64f9710) to branch 'im.pidgin.pidgin.next.minor' (head 685e1461486f2e5322bc2952f8e8bbbf4313dee9)
author Richard Laager <rlaager@wiktel.com>
date Fri, 02 Jan 2009 22:35:12 +0000
parents 4e8748f3374f c6cadb7bdcf7
children b5df6cd20d8b
line wrap: on
line diff
--- a/libpurple/protocols/myspace/myspace.c	Fri Jan 02 22:28:34 2009 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Fri Jan 02 22:35:12 2009 +0000
@@ -211,7 +211,6 @@
 			/* Don't have uid offhand - need to ask for it, and wait until hear back before sending. */
 			purple_debug_info("msim", ">>> msim_postprocess_outgoing: couldn't find username %s in blist\n",
 					username ? username : "(NULL)");
-			/* TODO: where is cloned message freed? Should be in _cb. */
 			msim_lookup_user(session, username, msim_postprocess_outgoing_cb, msim_msg_clone(msg));
 			return TRUE;       /* not sure of status yet - haven't sent! */
 		}
@@ -1930,8 +1929,7 @@
 
 	msim_process(session, msg);
 
-	/* TODO: Free copy cloned from  msim_preprocess_incoming(). */
-	/* msim_msg_free(msg); */
+	msim_msg_free(msg);
 	msim_msg_free(body);
 }
 
@@ -2747,6 +2745,9 @@
 	if (!msim_update_blocklist_for_buddy(session, name, FALSE, FALSE))
 		purple_notify_error(NULL, NULL,
 				_("Failed to remove buddy"), _("blocklist command failed"));
+		return;
+	}
+	msim_buddy_free(buddy);
 }
 
 /**
@@ -2766,7 +2767,6 @@
 			"sesskey", MSIM_TYPE_INTEGER, session->sesskey,
 			/* 'delprofileid' with uid will be inserted here. */
 			NULL);
-
 	if (!msim_postprocess_outgoing(session, msg, name, "delprofileid", NULL))
 		purple_debug_error("myspace", "delbuddy command failed\n");
 	msim_msg_free(msg);
@@ -2837,6 +2837,13 @@
 	msim_update_blocklist_for_buddy(session, name, FALSE, FALSE);
 }
 
+static void
+msim_buddy_free(PurpleBuddy *buddy)
+{
+	msim_user_free(purple_buddy_get_protocol_data(buddy));
+	purple_buddy_set_protocol_data(buddy, NULL);
+}
+
 /**
  * Returns a string of a username in canonical form. Basically removes all the
  * spaces, lowercases the string, and looks up user IDs to usernames.
@@ -3053,7 +3060,7 @@
 	NULL,              /* alias_buddy */
 	NULL,              /* group_buddy */
 	NULL,              /* rename_group */
-	NULL,              /* buddy_free */
+	msim_buddy_free,   /* buddy_free */
 	NULL,              /* convo_closed */
 	msim_normalize,    /* normalize */
 	NULL,              /* set_buddy_icon */