comparison libpurple/protocols/myspace/myspace.c @ 23786:e4a4bc86c547

propagate from branch 'im.pidgin.pidgin' (head 119df2055ed7ee5143047b4d18ae81d58c2feac6) to branch 'im.pidgin.pidgin.vv' (head 06ea1dd8fde62c8644d3a64b8f8e8a16d6a14dc9)
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 18 Mar 2008 05:40:29 +0000
parents efaecb71baad 3225c99785b8
children 92e71f6e10d4
comparison
equal deleted inserted replaced
23785:efaecb71baad 23786:e4a4bc86c547
342 342
343 g_return_val_if_fail(account != NULL, FALSE); 343 g_return_val_if_fail(account != NULL, FALSE);
344 344
345 purple_connection_update_progress(session->gc, _("Reading challenge"), 1, 4); 345 purple_connection_update_progress(session->gc, _("Reading challenge"), 1, 4);
346 346
347 purple_debug_info("msim", "nc is %d bytes, decoded\n", nc_len); 347 purple_debug_info("msim", "nc is %" G_GSIZE_FORMAT
348 " bytes, decoded\n", nc_len);
348 349
349 if (nc_len != MSIM_AUTH_CHALLENGE_LENGTH) { 350 if (nc_len != MSIM_AUTH_CHALLENGE_LENGTH) {
350 purple_debug_info("msim", "bad nc length: %x != 0x%x\n", nc_len, MSIM_AUTH_CHALLENGE_LENGTH); 351 purple_debug_info("msim", "bad nc length: %" G_GSIZE_MODIFIER
352 "x != 0x%x\n", nc_len, MSIM_AUTH_CHALLENGE_LENGTH);
351 purple_connection_error_reason (session->gc, 353 purple_connection_error_reason (session->gc,
352 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, 354 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
353 _("Unexpected challenge length from server")); 355 _("Unexpected challenge length from server"));
354 return FALSE; 356 return FALSE;
355 } 357 }
491 purple_cipher_context_destroy(rc4); 493 purple_cipher_context_destroy(rc4);
492 g_free(data); 494 g_free(data);
493 495
494 if (data_out_len != data_len) { 496 if (data_out_len != data_len) {
495 purple_debug_info("msim", "msim_compute_login_response: " 497 purple_debug_info("msim", "msim_compute_login_response: "
496 "data length mismatch: %d != %d\n", 498 "data length mismatch: %" G_GSIZE_FORMAT " != %"
497 data_out_len, data_len); 499 G_GSIZE_FORMAT "\n", data_out_len, data_len);
498 } 500 }
499 501
500 #ifdef MSIM_DEBUG_LOGIN_CHALLENGE 502 #ifdef MSIM_DEBUG_LOGIN_CHALLENGE
501 purple_debug_info("msim", "response=<%s>\n", data_out); 503 purple_debug_info("msim", "response=<%s>\n", data_out);
502 #endif 504 #endif
762 g_return_val_if_fail(msg_text != NULL, FALSE); 764 g_return_val_if_fail(msg_text != NULL, FALSE);
763 765
764 username = msim_msg_get_string(msg, "_username"); 766 username = msim_msg_get_string(msg, "_username");
765 g_return_val_if_fail(username != NULL, FALSE); 767 g_return_val_if_fail(username != NULL, FALSE);
766 768
767 purple_debug_info("msim", "msim_incoming_action: action <%s> from <%d>\n", 769 purple_debug_info("msim", "msim_incoming_action: action <%s> from <%s>\n",
768 msg_text, username); 770 msg_text, username);
769 771
770 if (g_str_equal(msg_text, "%typing%")) { 772 if (g_str_equal(msg_text, "%typing%")) {
771 serv_got_typing(session->gc, username, 0, PURPLE_TYPING); 773 serv_got_typing(session->gc, username, 0, PURPLE_TYPING);
772 rc = TRUE; 774 rc = TRUE;
2794 MsimUser *user; 2796 MsimUser *user;
2795 gchar *username, *group_name; 2797 gchar *username, *group_name;
2796 guint uid; 2798 guint uid;
2797 2799
2798 contact_info = (MsimMessage *)data; 2800 contact_info = (MsimMessage *)data;
2799 purple_debug_info("msim_add_contact_from_server_cb", "contact_info addr=%X\n", contact_info); 2801 purple_debug_info("msim_add_contact_from_server_cb", "contact_info addr=%p\n", contact_info);
2800 uid = msim_msg_get_integer(contact_info, "ContactID"); 2802 uid = msim_msg_get_integer(contact_info, "ContactID");
2801 2803
2802 if (!user_lookup_info) { 2804 if (!user_lookup_info) {
2803 username = g_strdup(msim_uid2username_from_blist(session->account, uid)); 2805 username = g_strdup(msim_uid2username_from_blist(session->account, uid));
2804 g_return_if_fail(username != NULL); 2806 g_return_if_fail(username != NULL);
2877 if (!username) { 2879 if (!username) {
2878 gchar *uid_str; 2880 gchar *uid_str;
2879 2881
2880 uid_str = g_strdup_printf("%d", uid); 2882 uid_str = g_strdup_printf("%d", uid);
2881 purple_debug_info("msim_add_contact_from_server", 2883 purple_debug_info("msim_add_contact_from_server",
2882 "contact_info addr=%X\n", contact_info); 2884 "contact_info addr=%p\n", contact_info);
2883 msim_lookup_user(session, uid_str, msim_add_contact_from_server_cb, (gpointer)msim_msg_clone(contact_info)); 2885 msim_lookup_user(session, uid_str, msim_add_contact_from_server_cb, (gpointer)msim_msg_clone(contact_info));
2884 g_free(uid_str); 2886 g_free(uid_str);
2885 } else { 2887 } else {
2886 msim_add_contact_from_server_cb(session, NULL, (gpointer)msim_msg_clone(contact_info)); 2888 msim_add_contact_from_server_cb(session, NULL, (gpointer)msim_msg_clone(contact_info));
2887 } 2889 }