changeset 27384:377e063ecda5

Convert the yahoo prpl to using the debug convenience functions instead of purple_debug().
author John Bailey <rekkanoryo@rekkanoryo.org>
date Sun, 05 Jul 2009 02:23:43 +0000
parents 84b2e1770ede
children 319b0f3dd2d0
files libpurple/protocols/yahoo/util.c libpurple/protocols/yahoo/yahoo.c libpurple/protocols/yahoo/yahoo_filexfer.c libpurple/protocols/yahoo/yahoo_packet.c libpurple/protocols/yahoo/yahoochat.c libpurple/protocols/yahoo/ycht.c
diffstat 6 files changed, 51 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/util.c	Sat Jul 04 23:52:03 2009 +0000
+++ b/libpurple/protocols/yahoo/util.c	Sun Jul 05 02:23:43 2009 +0000
@@ -354,7 +354,7 @@
 					else if ((match = (char *) g_hash_table_lookup(ht, tmp->str)))
 						g_string_append(s, match);
 					else {
-						purple_debug(PURPLE_DEBUG_ERROR, "yahoo",
+						purple_debug_error("yahoo",
 							"Unknown ansi code 'ESC[%sm'.\n", tmp->str);
 						g_string_free(tmp, TRUE);
 						break;
@@ -423,7 +423,7 @@
 
 	ret = s->str;
 	g_string_free(s, FALSE);
-	purple_debug(PURPLE_DEBUG_MISC, "yahoo", "yahoo_codes_to_html:  Returning string: '%s'.\n", ret);
+	purple_debug_misc("yahoo", "yahoo_codes_to_html:  Returning string: '%s'.\n", ret);
 	return ret;
 }
 
@@ -822,7 +822,7 @@
 	g_string_free(dest, FALSE);
 
 	esc = g_strescape(ret, NULL);
-	purple_debug(PURPLE_DEBUG_MISC, "yahoo", "yahoo_html_to_codes:  Returning string: '%s'.\n", esc);
+	purple_debug_misc("yahoo", "yahoo_html_to_codes:  Returning string: '%s'.\n", esc);
 	g_free(esc);
 
 	yahoo_htc_queue_cleanup(colors);
--- a/libpurple/protocols/yahoo/yahoo.c	Sat Jul 04 23:52:03 2009 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Sun Jul 05 02:23:43 2009 +0000
@@ -390,7 +390,7 @@
 		b = i->data;
 		g = purple_buddy_get_group(b);
 		if (!purple_utf8_strcasecmp(group, purple_group_get_name(g))) {
-			purple_debug(PURPLE_DEBUG_MISC, "yahoo",
+			purple_debug_misc("yahoo",
 				"Oh good, %s is in the right group (%s).\n", name, group);
 			list = g_slist_delete_link(list, i);
 			onlist = 1;
@@ -399,7 +399,7 @@
 	}
 
 	if (!onlist) {
-		purple_debug(PURPLE_DEBUG_MISC, "yahoo",
+		purple_debug_misc("yahoo",
 			"Uhoh, %s isn't on the list (or not in this group), adding him to group %s.\n", name, group);
 		if (!(g = purple_find_group(group))) {
 			g = purple_group_new(group);
@@ -427,7 +427,7 @@
 	for (i = list; i; i = i->next) {
 		b = i->data;
 		g = purple_buddy_get_group(b);
-		purple_debug(PURPLE_DEBUG_MISC, "yahoo", "Deleting Buddy %s from group %s.\n", name,
+		purple_debug_misc("yahoo", "Deleting Buddy %s from group %s.\n", name,
 				purple_group_get_name(g));
 		purple_blist_remove_buddy(b);
 	}
@@ -801,9 +801,8 @@
 		PurpleBuddy *bud = purple_find_buddy(account, from);
 
 		if (!bud) {
-			purple_debug(PURPLE_DEBUG_WARNING, "yahoo",
-					   "%s is playing a game, and doesn't want "
-					   "you to know.\n", from);
+			purple_debug_warning("yahoo",
+					   "%s is playing a game, and doesn't want you to know.\n", from);
 		}
 
 		f = yahoo_friend_find(gc, from);
@@ -1943,8 +1942,7 @@
 	name = g_strdup(purple_buddy_get_name(buddy));
 	account = purple_buddy_get_account(buddy);
 
-	purple_debug(PURPLE_DEBUG_INFO, "blist",
-		"Removing '%s' from buddy list.\n", name);
+	purple_debug_info("yahoo", "blist: Removing '%s' from buddy list.\n", name);
 	purple_account_remove_buddy(account, buddy, group);
 	purple_blist_remove_buddy(buddy);
 
@@ -2382,14 +2380,14 @@
 	pos += 2;
 
 	pktlen = yahoo_get16(buf + pos); pos += 2;
-	purple_debug(PURPLE_DEBUG_MISC, "yahoo", "p2p: %d bytes to read\n", len);
+	purple_debug_misc("yahoo", "p2p: %d bytes to read\n", len);
 
 	pkt = yahoo_packet_new(0, 0, 0);
 	pkt->service = yahoo_get16(buf + pos); pos += 2;
 	pkt->status = yahoo_get32(buf + pos); pos += 4;
 	pkt->id = yahoo_get32(buf + pos); pos += 4;
 
-	purple_debug(PURPLE_DEBUG_MISC, "yahoo", "p2p: Yahoo Service: 0x%02x Status: %d\n",pkt->service, pkt->status);
+	purple_debug_misc("yahoo", "p2p: Yahoo Service: 0x%02x Status: %d\n",pkt->service, pkt->status);
 	yahoo_packet_read(pkt, buf + pos, pktlen);
 
 	/* packet processing */
@@ -2909,8 +2907,7 @@
 		break;
 
 	default:
-		purple_debug(PURPLE_DEBUG_ERROR, "yahoo",
-				   "Unhandled service 0x%02x\n", pkt->service);
+		purple_debug_error("yahoo", "Unhandled service 0x%02x\n", pkt->service);
 		break;
 	}
 }
@@ -2979,8 +2976,7 @@
 		pos += 2;
 
 		pktlen = yahoo_get16(yd->rxqueue + pos); pos += 2;
-		purple_debug(PURPLE_DEBUG_MISC, "yahoo",
-				   "%d bytes to read, rxlen is %d\n", pktlen, yd->rxlen);
+		purple_debug_misc("yahoo", "%d bytes to read, rxlen is %d\n", pktlen, yd->rxlen);
 
 		if (yd->rxlen < (YAHOO_PACKET_HDRLEN + pktlen))
 			return;
@@ -2991,8 +2987,7 @@
 
 		pkt->service = yahoo_get16(yd->rxqueue + pos); pos += 2;
 		pkt->status = yahoo_get32(yd->rxqueue + pos); pos += 4;
-		purple_debug(PURPLE_DEBUG_MISC, "yahoo",
-				   "Yahoo Service: 0x%02x Status: %d\n",
+		purple_debug_misc("yahoo", "Yahoo Service: 0x%02x Status: %d\n",
 				   pkt->service, pkt->status);
 		pkt->id = yahoo_get32(yd->rxqueue + pos); pos += 4;
 
@@ -4882,8 +4877,7 @@
 	gc = purple_conversation_get_gc(conv);
 	yd = gc->proto_data;
 	id = yd->conf_id;
-	purple_debug(PURPLE_DEBUG_INFO, "yahoo",
-	           "Trying to join %s \n", args[0]);
+	purple_debug_info("yahoo", "Trying to join %s \n", args[0]);
 
 	comp = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
 	g_hash_table_replace(comp, g_strdup("room"), g_ascii_strdown(args[0], -1));
@@ -4920,8 +4914,8 @@
 
 	g_return_val_if_fail(c != NULL, FALSE);
 
-	purple_debug(PURPLE_DEBUG_INFO, "yahoo",
-	           "Sending <ding> on account %s to buddy %s.\n", username, c->name);
+	purple_debug_info("yahoo", "Sending <ding> on account %s to buddy %s.\n",
+			username, c->name);
 	purple_conv_im_send_with_flags(PURPLE_CONV_IM(c), "<ding>", PURPLE_MESSAGE_INVISIBLE);
 
 	return TRUE;
--- a/libpurple/protocols/yahoo/yahoo_filexfer.c	Sat Jul 04 23:52:03 2009 +0000
+++ b/libpurple/protocols/yahoo/yahoo_filexfer.c	Sun Jul 05 02:23:43 2009 +0000
@@ -156,8 +156,8 @@
 	PurpleXfer *xfer;
 	struct yahoo_xfer_data *xd;
 
-	purple_debug(PURPLE_DEBUG_INFO, "yahoo",
-			   "AAA - in yahoo_receivefile_connected\n");
+	purple_debug_info("yahoo", "in yahoo_receivefile_connected\n");
+
 	if (!(xfer = data))
 		return;
 	if (!(xd = xfer->data))
@@ -235,8 +235,8 @@
 	PurpleAccount *account;
 	struct yahoo_data *yd;
 
-	purple_debug(PURPLE_DEBUG_INFO, "yahoo",
-			   "AAA - in yahoo_sendfile_connected\n");
+	purple_debug_info("yahoo", "in yahoo_sendfile_connected\n");
+
 	if (!(xfer = data))
 		return;
 	if (!(xd = xfer->data))
--- a/libpurple/protocols/yahoo/yahoo_packet.c	Sat Jul 04 23:52:03 2009 +0000
+++ b/libpurple/protocols/yahoo/yahoo_packet.c	Sun Jul 05 02:23:43 2009 +0000
@@ -190,8 +190,7 @@
 			if (purple_debug_is_verbose()) {
 				char *esc;
 				esc = g_strescape(pair->value, NULL);
-				purple_debug(PURPLE_DEBUG_MISC, "yahoo",
-						   "Key: %d  \tValue: %s\n", pair->key, esc);
+				purple_debug_misc("yahoo", "Key: %d  \tValue: %s\n", pair->key, esc);
 				g_free(esc);
 			}
 		} else {
@@ -251,35 +250,35 @@
 #ifdef YAHOO_DEBUG
 	int i;
 
-	purple_debug(PURPLE_DEBUG_MISC, "yahoo", "");
+	purple_debug_misc("yahoo", "");
 
 	for (i = 0; i + 1 < len; i += 2) {
 		if ((i % 16 == 0) && i) {
-			purple_debug(PURPLE_DEBUG_MISC, NULL, "\n");
-			purple_debug(PURPLE_DEBUG_MISC, "yahoo", "");
+			purple_debug_misc(NULL, "\n");
+			purple_debug_misc("yahoo", "");
 		}
 
-		purple_debug(PURPLE_DEBUG_MISC, NULL, "%02x%02x ", data[i], data[i + 1]);
+		purple_debug_misc(NULL, "%02x%02x ", data[i], data[i + 1]);
 	}
 	if (i < len)
-		purple_debug(PURPLE_DEBUG_MISC, NULL, "%02x", data[i]);
+		purple_debug_misc(NULL, "%02x", data[i]);
 
-	purple_debug(PURPLE_DEBUG_MISC, NULL, "\n");
-	purple_debug(PURPLE_DEBUG_MISC, "yahoo", "");
+	purple_debug_misc(NULL, "\n");
+	purple_debug_misc("yahoo", "");
 
 	for (i = 0; i < len; i++) {
 		if ((i % 16 == 0) && i) {
-			purple_debug(PURPLE_DEBUG_MISC, NULL, "\n");
-			purple_debug(PURPLE_DEBUG_MISC, "yahoo", "");
+			purple_debug_misc(NULL, "\n");
+			purple_debug_misc("yahoo", "");
 		}
 
 		if (g_ascii_isprint(data[i]))
-			purple_debug(PURPLE_DEBUG_MISC, NULL, "%c ", data[i]);
+			purple_debug_misc(NULL, "%c ", data[i]);
 		else
-			purple_debug(PURPLE_DEBUG_MISC, NULL, ". ");
+			purple_debug_misc(NULL, ". ");
 	}
 
-	purple_debug(PURPLE_DEBUG_MISC, NULL, "\n");
+	purple_debug_misc(NULL, "\n");
 #endif /* YAHOO_DEBUG */
 }
 
--- a/libpurple/protocols/yahoo/yahoochat.c	Sat Jul 04 23:52:03 2009 +0000
+++ b/libpurple/protocols/yahoo/yahoochat.c	Sun Jul 05 02:23:43 2009 +0000
@@ -648,7 +648,7 @@
 	}
 
 	if (!msg) {
-		purple_debug(PURPLE_DEBUG_MISC, "yahoo", "Got a message packet with no message.\nThis probably means something important, but we're ignoring it.\n");
+		purple_debug_misc("yahoo", "Got a message packet with no message.\nThis probably means something important, but we're ignoring it.\n");
 		return;
 	}
 	msg2 = yahoo_string_decode(gc, msg, utf8);
--- a/libpurple/protocols/yahoo/ycht.c	Sat Jul 04 23:52:03 2009 +0000
+++ b/libpurple/protocols/yahoo/ycht.c	Sun Jul 05 02:23:43 2009 +0000
@@ -196,35 +196,35 @@
 #ifdef YAHOO_YCHT_DEBUG
 	int i;
 
-	purple_debug(PURPLE_DEBUG_MISC, "yahoo", "");
+	purple_debug_misc("yahoo", "");
 
 	for (i = 0; i + 1 < len; i += 2) {
 		if ((i % 16 == 0) && i) {
-			purple_debug(PURPLE_DEBUG_MISC, NULL, "\n");
-			purple_debug(PURPLE_DEBUG_MISC, "yahoo", "");
+			purple_debug_misc(NULL, "\n");
+			purple_debug_misc("yahoo", "");
 		}
 
-		purple_debug(PURPLE_DEBUG_MISC, NULL, "%02hhx%02hhx ", data[i], data[i + 1]);
+		purple_debug_misc(NULL, "%02hhx%02hhx ", data[i], data[i + 1]);
 	}
 	if (i < len)
-		purple_debug(PURPLE_DEBUG_MISC, NULL, "%02hhx", data[i]);
+		purple_debug_misc(NULL, "%02hhx", data[i]);
 
-	purple_debug(PURPLE_DEBUG_MISC, NULL, "\n");
-	purple_debug(PURPLE_DEBUG_MISC, "yahoo", "");
+	purple_debug_misc(NULL, "\n");
+	purple_debug_misc("yahoo", "");
 
 	for (i = 0; i < len; i++) {
 		if ((i % 16 == 0) && i) {
-			purple_debug(PURPLE_DEBUG_MISC, NULL, "\n");
-			purple_debug(PURPLE_DEBUG_MISC, "yahoo", "");
+			purple_debug_misc(NULL, "\n");
+			purple_debug_misc("yahoo", "");
 		}
 
 		if (g_ascii_isprint(data[i]))
-			purple_debug(PURPLE_DEBUG_MISC, NULL, "%c ", data[i]);
+			purple_debug_misc(NULL, "%c ", data[i]);
 		else
-			purple_debug(PURPLE_DEBUG_MISC, NULL, ". ");
+			purple_debug_misc(NULL, ". ");
 	}
 
-	purple_debug(PURPLE_DEBUG_MISC, NULL, "\n");
+	purple_debug_misc(NULL, "\n");
 #endif /* YAHOO_YCHT_DEBUG */
 }
 
@@ -507,16 +507,15 @@
 		service = yahoo_get32(ycht->rxqueue + pos); pos += 4;
 		status = yahoo_get16(ycht->rxqueue + pos); pos += 2;
 		pktlen  = yahoo_get16(ycht->rxqueue + pos); pos += 2;
-		purple_debug(PURPLE_DEBUG_MISC, "yahoo",
-				   "ycht: %d bytes to read, rxlen is %d\n", pktlen, ycht->rxlen);
+		purple_debug_misc("yahoo", "ycht: %d bytes to read, rxlen is %d\n",
+				pktlen, ycht->rxlen);
 
 		if (ycht->rxlen < (YCHT_HEADER_LEN + pktlen))
 			return;
 
 		purple_debug_misc("yahoo", "--==Incoming YCHT packet==--\n");
-		purple_debug(PURPLE_DEBUG_MISC, "yahoo",
-			   "YCHT Service: 0x%02x Version: 0x%02x Status: 0x%02x\n",
-			   service, version, status);
+		purple_debug_misc("yahoo", "YCHT Service: 0x%02x Version: 0x%02x Status: 0x%02x\n",
+				service, version, status);
 		ycht_packet_dump(ycht->rxqueue, YCHT_HEADER_LEN + pktlen);
 
 		pkt = ycht_packet_new(version, service, status);