comparison libpurple/protocols/myspace/myspace.c @ 17355:9c5b1dc7404f

Change msim_msg_debug_string() to msim_msg_dump(), which prints the string using purple_debug_info() using a given formatting string. Simplifies usage.
author Jeffrey Connelly <jaconnel@calpoly.edu>
date Mon, 04 Jun 2007 01:59:20 +0000
parents c2208b64bffb
children c6305f8845d8
comparison
equal deleted inserted replaced
17354:c2208b64bffb 17355:9c5b1dc7404f
828 828
829 session = (MsimSession *)gc->proto_data; 829 session = (MsimSession *)gc->proto_data;
830 830
831 #ifdef MSIM_DEBUG_MSG 831 #ifdef MSIM_DEBUG_MSG
832 { 832 {
833 gchar *debug_msg; 833 msim_msg_dump("ready to process: %s\n", msg);
834
835 debug_msg = msim_msg_debug_string(msg);
836 purple_debug_info("msim", "%s\n", debug_msg);
837 g_free(debug_msg);
838 } 834 }
839 #endif 835 #endif
840 836
841 if (msim_msg_get(msg, "nc")) 837 if (msim_msg_get(msg, "nc"))
842 { 838 {
1085 "msim_status: making new buddy for %s\n", username); 1081 "msim_status: making new buddy for %s\n", username);
1086 buddy = purple_buddy_new(session->account, username, NULL); 1082 buddy = purple_buddy_new(session->account, username, NULL);
1087 1083
1088 /* TODO: sometimes (when click on it), buddy list disappears. Fix. */ 1084 /* TODO: sometimes (when click on it), buddy list disappears. Fix. */
1089 purple_blist_add_buddy(buddy, NULL, NULL, NULL); 1085 purple_blist_add_buddy(buddy, NULL, NULL, NULL);
1086 //purple_blist_set_int(&buddy->node, "uid", XYZ);
1087 exit(0);
1090 } else { 1088 } else {
1091 purple_debug_info("msim", "msim_status: found buddy %s\n", username); 1089 purple_debug_info("msim", "msim_status: found buddy %s\n", username);
1092 } 1090 }
1093 1091
1094 /* TODO: show headline */ 1092 /* TODO: show headline */
1362 { 1360 {
1363 /* Process message and then free it (processing function should 1361 /* Process message and then free it (processing function should
1364 * clone message if it wants to keep it afterwards.) */ 1362 * clone message if it wants to keep it afterwards.) */
1365 if (!msim_process(gc, msg)) 1363 if (!msim_process(gc, msg))
1366 { 1364 {
1367 gchar *dbs; 1365 msim_msg_dump("msim_input_cb: processing message failed on msg: %s\n", msg);
1368
1369 dbs = msim_msg_debug_string(msg);
1370 purple_debug_info("msim", "msim_input_cb: processing message failed on msg: %s\n",
1371 dbs);
1372 g_free(dbs);
1373 } 1366 }
1374 msim_msg_free(msg); 1367 msim_msg_free(msg);
1375 } 1368 }
1376 1369
1377 /* Move remaining part of buffer to beginning. */ 1370 /* Move remaining part of buffer to beginning. */
1787 msg = msim_msg_append(msg, "k1", MSIM_TYPE_INTEGER, GUINT_TO_POINTER(42)); 1780 msg = msim_msg_append(msg, "k1", MSIM_TYPE_INTEGER, GUINT_TO_POINTER(42));
1788 msg = msim_msg_append(msg, "k1", MSIM_TYPE_STRING, g_strdup("v43")); 1781 msg = msim_msg_append(msg, "k1", MSIM_TYPE_STRING, g_strdup("v43"));
1789 msg = msim_msg_append(msg, "k1", MSIM_TYPE_STRING, g_strdup("v52/xxx\\yyy")); 1782 msg = msim_msg_append(msg, "k1", MSIM_TYPE_STRING, g_strdup("v52/xxx\\yyy"));
1790 msg = msim_msg_append(msg, "k1", MSIM_TYPE_STRING, g_strdup("v7")); 1783 msg = msim_msg_append(msg, "k1", MSIM_TYPE_STRING, g_strdup("v7"));
1791 purple_debug_info("msim", "msg debug str=%s\n", msim_msg_debug_string(msg)); 1784 purple_debug_info("msim", "msg debug str=%s\n", msim_msg_debug_string(msg));
1785 msim_msg_debug_dump("msg debug str=%s\n", msg);
1792 purple_debug_info("msim", "msg packed=%s\n", msim_msg_pack(msg)); 1786 purple_debug_info("msim", "msg packed=%s\n", msim_msg_pack(msg));
1793 purple_debug_info("msim", "msg cloned=%s\n", msim_msg_pack(msim_msg_clone(msg))); 1787 purple_debug_info("msim", "msg cloned=%s\n", msim_msg_pack(msim_msg_clone(msg)));
1794 msim_msg_free(msg); 1788 msim_msg_free(msg);
1795 exit(0); 1789 exit(0);
1796 } 1790 }