changeset 24743:5f8e8b89b143

Remove a bunch of calls to msim_msg_dump(). I find it really annoying that incoming messages get printed multiple times. The entire thing is printed in msim_parse(), so why would we want to print it anywhere else?
author Mark Doliner <mark@kingant.net>
date Tue, 16 Dec 2008 21:31:05 +0000
parents b9e1e062007e
children e5f8d9ba84db
files libpurple/protocols/myspace/message.c libpurple/protocols/myspace/myspace.c libpurple/protocols/myspace/myspace.h libpurple/protocols/myspace/user.c
diffstat 4 files changed, 4 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/myspace/message.c	Tue Dec 16 19:36:03 2008 +0000
+++ b/libpurple/protocols/myspace/message.c	Tue Dec 16 21:31:05 2008 +0000
@@ -715,10 +715,6 @@
 		return;
 	}
 
-#ifdef MSIM_MSG_DEBUG_FREE
-	msim_msg_dump("msim_msg_free: freeing %s", msg);
-#endif
-
 	g_list_foreach(msg, msim_msg_free_element, NULL);
 	g_list_free(msg);
 }
@@ -872,8 +868,6 @@
 	success = msim_send_raw(session, raw);
 	g_free(raw);
 
-	msim_msg_dump("msim_msg_send()ing %s\n", msg);
-
 	return success;
 }
 
--- a/libpurple/protocols/myspace/myspace.c	Tue Dec 16 19:36:03 2008 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Tue Dec 16 21:31:05 2008 +0000
@@ -60,7 +60,6 @@
 		const gchar *uid_field_name, guint uid)
 {
 	MsimMessageElement *elem;
-	msim_msg_dump("msim_do_postprocessing msg: %s\n", msg);
 
 	/* First, check - if the field already exists, replace <uid> within it */
 	if ((elem = msim_msg_get(msg, uid_field_name)) != NULL) {
@@ -95,8 +94,6 @@
 		msg = msim_msg_insert_before(msg, uid_before, uid_field_name, MSIM_TYPE_INTEGER, GUINT_TO_POINTER(uid));
 	}
 
-	msim_msg_dump("msim_postprocess_outgoing_cb: postprocessed msg=%s\n", msg);
-
 	return msg;
 }
 
@@ -122,8 +119,6 @@
 
 	msg = (MsimMessage *)data;
 
-	msim_msg_dump("msim_postprocess_outgoing_cb() got msg=%s\n", msg);
-
 	/* Obtain userid from userinfo message. */
 	body = msim_msg_get_dictionary(userinfo, "body");
 	g_return_if_fail(body != NULL);
@@ -194,7 +189,6 @@
 	g_return_val_if_fail(msg != NULL, FALSE);
 
 	/* Store information for msim_postprocess_outgoing_cb(). */
-	msim_msg_dump("msim_postprocess_outgoing: msg before=%s\n", msg);
 	msg = msim_msg_append(msg, "_username", MSIM_TYPE_STRING, g_strdup(username));
 	msg = msim_msg_append(msg, "_uid_field_name", MSIM_TYPE_STRING, g_strdup(uid_field_name));
 	msg = msim_msg_append(msg, "_uid_before", MSIM_TYPE_STRING, g_strdup(uid_before));
@@ -215,7 +209,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)");
-			msim_msg_dump("msim_postprocess_outgoing - scheduling lookup, msg=%s\n", msg);
 			/* 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! */
@@ -228,8 +221,6 @@
 
 	msg = msim_do_postprocessing(msg, uid_before, uid_field_name, uid);
 
-	msim_msg_dump("msim_postprocess_outgoing: msg after (uid immediate)=%s\n", msg);
-
 	rc = msim_msg_send(session, msg);
 
 	/* TODO: free
@@ -867,8 +858,6 @@
 
 	g_return_if_fail(reply != NULL);
 
-	msim_msg_dump("msim_check_inbox_cb: reply=%s\n", reply);
-
 	body = msim_msg_get_dictionary(reply, "body");
 
 	if (body == NULL)
@@ -1081,8 +1070,6 @@
 	gchar *msg;
 	guint buddy_count;
 
-	msim_msg_dump("msim_got_contact_list: reply=%s", reply);
-
 	body = msim_msg_get_dictionary(reply, "body");
 	if (!body) {
 		/* No friends. Not an error. */
@@ -1311,8 +1298,6 @@
 	g_return_val_if_fail(MSIM_SESSION_VALID(session), FALSE);
 	g_return_val_if_fail(msg != NULL, FALSE);
 
-	msim_msg_dump("msim_status msg=%s\n", msg);
-
 	/* Helpfully looked up by msim_incoming_resolve() for us. */
 	username = msim_msg_get_string(msg, "_username");
 	g_return_val_if_fail(username != NULL, FALSE);
@@ -1750,7 +1735,6 @@
 
 	if (cb) {
 		purple_debug_info("msim", "msim_process_reply: calling callback now\n");
-		msim_msg_dump("for msg=%s\n", msg);
 		/* Clone message, so that the callback 'cb' can use it (needs to free it also). */
 		cb(session, msim_msg_clone(msg), data);
 		g_hash_table_remove(session->user_lookup_cb, GUINT_TO_POINTER(rid));
@@ -1850,10 +1834,6 @@
 	g_return_val_if_fail(session != NULL, FALSE);
 	g_return_val_if_fail(msg != NULL, FALSE);
 
-#ifdef MSIM_DEBUG_MSG
-	msim_msg_dump("ready to process: %s\n", msg);
-#endif
-
 	if (msim_msg_get_integer(msg, "lc") == 1) {
 		return msim_login_challenge(session, msg);
 	} else if (msim_msg_get_integer(msg, "lc") == 2) {
@@ -2782,6 +2762,10 @@
  *
  * @return Bytes successfully sent, or -1 on error.
  */
+/*
+ * TODO: This needs to do non-blocking writes and use a watcher to check
+  *      when the fd is available to be written to.
+ */
 static int
 msim_send_really_raw(PurpleConnection *gc, const char *buf, int total_bytes)
 {
@@ -2956,7 +2940,6 @@
 {
 	MsimMessage *body;
 	gchar *completed;
-	msim_msg_dump("msim_import_friends_cb=%s", reply);
 
 	/* Check if the friends were imported successfully. */
 	body = msim_msg_get_dictionary(reply, "body");
@@ -3445,16 +3428,6 @@
 	return FALSE;
 }
 
-#ifdef MSIM_DEBUG_MSG
-static void
-print_hash_item(gpointer key, gpointer value, gpointer user_data)
-{
-	purple_debug_info("msim", "%s=%s\n",
-			key ? (gchar *)key : "(NULL)",
-			value ? (gchar *)value : "(NULL)");
-}
-#endif
-
 /**
  * Initialize plugin.
  */
--- a/libpurple/protocols/myspace/myspace.h	Tue Dec 16 19:36:03 2008 +0000
+++ b/libpurple/protocols/myspace/myspace.h	Tue Dec 16 21:31:05 2008 +0000
@@ -63,7 +63,6 @@
 /*#define MSIM_SEND_CLIENT_VERSION              */
 
 /* Debugging options */
-/*#define MSIM_DEBUG_MSG                */
 /* Low-level and rarely needed */
 /*#define MSIM_DEBUG_PARSE             */
 /*#define MSIM_DEBUG_LOGIN_CHALLENGE*/
--- a/libpurple/protocols/myspace/user.c	Tue Dec 16 19:36:03 2008 +0000
+++ b/libpurple/protocols/myspace/user.c	Tue Dec 16 21:31:05 2008 +0000
@@ -532,8 +532,6 @@
 	purple_debug_info("msim", "msim_lookup_userid: "
 			"asynchronously looking up <%s>\n", user);
 
-	msim_msg_dump("msim_lookup_user: data=%s\n", (MsimMessage *)data);
-
 	/* Setup callback. Response will be associated with request using 'rid'. */
 	rid = msim_new_reply_callback(session, cb, data);
 
@@ -587,7 +585,6 @@
 
 	g_return_if_fail(MSIM_SESSION_VALID(session));
 
-	msim_msg_dump("username_is_set message is: %s\n", userinfo);
 	cmd = msim_msg_get_integer(userinfo, "cmd");
 	dsn = msim_msg_get_integer(userinfo, "dsn");
 	uid = msim_msg_get_integer(userinfo, "uid");
@@ -675,8 +672,6 @@
 	purple_debug_info("msim", "msim_set_username: "
 			"Setting username %s\n", username);
 
-	msim_msg_dump("msim_set_username: data=%s\n", (MsimMessage *)data);
-
 	/* Setup callback. Response will be associated with request using 'rid'. */
 	rid = msim_new_reply_callback(session, cb, data);