Mercurial > pidgin
diff libpurple/protocols/msn/switchboard.c @ 27432:35b6fd563056
Change all MSN_DEBUG_* messages to use the new purple_debug_is_verbose call
for runtime switching.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Fri, 10 Jul 2009 00:51:31 +0000 |
parents | a6d84d9de605 |
children | 4fb5e292de75 |
line wrap: on
line diff
--- a/libpurple/protocols/msn/switchboard.c Thu Jul 09 05:37:37 2009 +0000 +++ b/libpurple/protocols/msn/switchboard.c Fri Jul 10 00:51:31 2009 +0000 @@ -60,6 +60,9 @@ session->switches = g_list_prepend(session->switches, swboard); + if (purple_debug_is_verbose()) + purple_debug_info("msn", "switchboard new: swboard(%p)\n", swboard); + return swboard; } @@ -70,9 +73,8 @@ MsnMessage *msg; GList *l; -#ifdef MSN_DEBUG_SB - purple_debug_info("msn", "switchboard_destroy: swboard(%p)\n", swboard); -#endif + if (purple_debug_is_verbose()) + purple_debug_info("msn", "switchboard destroy: swboard(%p)\n", swboard); g_return_if_fail(swboard != NULL); @@ -230,10 +232,9 @@ swboard->current_users++; swboard->empty = FALSE; -#ifdef MSN_DEBUG_CHAT - purple_debug_info("msn", "user=[%s], total=%d\n", user, - swboard->current_users); -#endif + if (purple_debug_is_verbose()) + purple_debug_info("msn", "user=[%s], total=%d\n", + user, swboard->current_users); if (!(swboard->flag & MSN_SB_FLAG_IM) && (swboard->conv != NULL)) { @@ -255,10 +256,6 @@ { GList *l; -#ifdef MSN_DEBUG_CHAT - purple_debug_info("msn", "[chat] Switching to chat.\n"); -#endif - #if 0 /* this is bad - it causes msn_switchboard_close to be called on the * switchboard we're in the middle of using :( */ @@ -278,18 +275,10 @@ tmp_user = l->data; -#ifdef MSN_DEBUG_CHAT - purple_debug_info("msn", "[chat] Adding [%s].\n", tmp_user); -#endif - purple_conv_chat_add_user(PURPLE_CONV_CHAT(swboard->conv), tmp_user, NULL, PURPLE_CBFLAGS_NONE, TRUE); } -#ifdef MSN_DEBUG_CHAT - purple_debug_info("msn", "[chat] We add ourselves.\n"); -#endif - purple_conv_chat_add_user(PURPLE_CONV_CHAT(swboard->conv), purple_account_get_username(account), NULL, PURPLE_CBFLAGS_NONE, TRUE); @@ -589,10 +578,10 @@ payload = msn_message_gen_payload(msg, &payload_len); -#ifdef MSN_DEBUG_SB - purple_debug_info("msn", "SB length:{%" G_GSIZE_FORMAT "}\n", payload_len); - msn_message_show_readable(msg, "SB SEND", FALSE); -#endif + if (purple_debug_is_verbose()) { + purple_debug_info("msn", "SB length:{%" G_GSIZE_FORMAT "}\n", payload_len); + msn_message_show_readable(msg, "SB SEND", FALSE); + } flag = msn_message_get_flag(msg); trans = msn_transaction_new(cmdproc, "MSG", "%c %" G_GSIZE_FORMAT, @@ -790,9 +779,8 @@ msn_message_parse_payload(msg, payload, len, MSG_LINE_DEM,MSG_BODY_DEM); -#ifdef MSN_DEBUG_SB - msn_message_show_readable(msg, "SB RECV", FALSE); -#endif + if (purple_debug_is_verbose()) + msn_message_show_readable(msg, "SB RECV", FALSE); g_free (msg->remote_user); msg->remote_user = g_strdup(cmd->params[0]);