Mercurial > pidgin
comparison libpurple/protocols/myspace/myspace.c @ 19657:9cc67c3d145e
merge of 'cce02af7eb2fb114cb0f640979554b7de3a80e96'
and 'db5ad5300e844751f9abf8702f4e4a8369dfef8e'
author | Ka-Hing Cheung <khc@hxbc.us> |
---|---|
date | Thu, 06 Sep 2007 06:26:32 +0000 |
parents | 9968fff36e20 941965d6fd88 |
children | 3617681a2694 |
comparison
equal
deleted
inserted
replaced
19629:9968fff36e20 | 19657:9cc67c3d145e |
---|---|
930 msg = (MsimMessage *)data; | 930 msg = (MsimMessage *)data; |
931 g_return_if_fail(msg != NULL); | 931 g_return_if_fail(msg != NULL); |
932 | 932 |
933 username = msim_msg_get_string(msg, "user"); | 933 username = msim_msg_get_string(msg, "user"); |
934 if (!username) { | 934 if (!username) { |
935 purple_debug_info("msim", "msim_get_info_cb: no 'user' in msg"); | 935 purple_debug_info("msim", "msim_get_info_cb: no 'user' in msg\n"); |
936 return; | 936 return; |
937 } | 937 } |
938 | 938 |
939 msim_msg_free(msg); | 939 msim_msg_free(msg); |
940 purple_debug_info("msim", "msim_get_info_cb: got for user: %s\n", username); | 940 purple_debug_info("msim", "msim_get_info_cb: got for user: %s\n", username); |
1118 "sesskey", MSIM_TYPE_INTEGER, session->sesskey, | 1118 "sesskey", MSIM_TYPE_INTEGER, session->sesskey, |
1119 "statstring", MSIM_TYPE_STRING, statstring, | 1119 "statstring", MSIM_TYPE_STRING, statstring, |
1120 "locstring", MSIM_TYPE_STRING, g_strdup(""), | 1120 "locstring", MSIM_TYPE_STRING, g_strdup(""), |
1121 NULL)) | 1121 NULL)) |
1122 { | 1122 { |
1123 purple_debug_info("msim", "msim_set_status: failed to set status"); | 1123 purple_debug_info("msim", "msim_set_status: failed to set status\n"); |
1124 } | 1124 } |
1125 | 1125 |
1126 } | 1126 } |
1127 | 1127 |
1128 /** After a uid is resolved to username, tag it with the username and submit for processing. | 1128 /** After a uid is resolved to username, tag it with the username and submit for processing. |
1180 | 1180 |
1181 buddies = purple_find_buddies(session->account, NULL); | 1181 buddies = purple_find_buddies(session->account, NULL); |
1182 | 1182 |
1183 if (!buddies) | 1183 if (!buddies) |
1184 { | 1184 { |
1185 purple_debug_info("msim", "msim_uid2username_from_blist: no buddies?"); | 1185 purple_debug_info("msim", "msim_uid2username_from_blist: no buddies?\n"); |
1186 return NULL; | 1186 return NULL; |
1187 } | 1187 } |
1188 | 1188 |
1189 ret = NULL; | 1189 ret = NULL; |
1190 | 1190 |
1540 | 1540 |
1541 /* Additional post-connect operations */ | 1541 /* Additional post-connect operations */ |
1542 | 1542 |
1543 | 1543 |
1544 if (msim_msg_get_integer(msg, "uniquenick") == session->userid) { | 1544 if (msim_msg_get_integer(msg, "uniquenick") == session->userid) { |
1545 purple_debug_info("msim_we_are_logged_on", "TODO: pick username"); | 1545 purple_debug_info("msim_we_are_logged_on", "TODO: pick username\n"); |
1546 /* No username is set. */ | 1546 /* No username is set. */ |
1547 purple_notify_error(session->account, | 1547 purple_notify_error(session->account, |
1548 _("No username set"), | 1548 _("No username set"), |
1549 _("Please go to http://editprofile.myspace.com/index.cfm?fuseaction=profile.username and choose a username and try to login again."), NULL); | 1549 _("Please go to http://editprofile.myspace.com/index.cfm?fuseaction=profile.username and choose a username and try to login again."), NULL); |
1550 purple_connection_error(session->gc, _("No username set")); | 1550 purple_connection_error(session->gc, _("No username set")); |
1779 g_free(errmsg); | 1779 g_free(errmsg); |
1780 | 1780 |
1781 purple_debug_info("msim", "msim_error (sesskey=%d): %s\n", | 1781 purple_debug_info("msim", "msim_error (sesskey=%d): %s\n", |
1782 session->sesskey, full_errmsg); | 1782 session->sesskey, full_errmsg); |
1783 | 1783 |
1784 purple_notify_error(session->account, g_strdup(_("MySpaceIM Error")), | |
1785 full_errmsg, NULL); | |
1786 | |
1787 /* Destroy session if fatal. */ | 1784 /* Destroy session if fatal. */ |
1788 if (msim_msg_get(msg, "fatal")) { | 1785 if (msim_msg_get(msg, "fatal")) { |
1789 purple_debug_info("msim", "fatal error, closing\n"); | 1786 purple_debug_info("msim", "fatal error, closing\n"); |
1787 if (err == 260) { | |
1788 /* Incorrect password */ | |
1789 session->gc->wants_to_die = TRUE; | |
1790 if (!purple_account_get_remember_password(session->account)) | |
1791 purple_account_set_password(session->account, NULL); | |
1792 } | |
1790 purple_connection_error(session->gc, full_errmsg); | 1793 purple_connection_error(session->gc, full_errmsg); |
1791 } | 1794 } else { |
1795 purple_notify_error(session->account, g_strdup(_("MySpaceIM Error")), | |
1796 full_errmsg, NULL); | |
1797 } | |
1798 | |
1799 g_free(full_errmsg); | |
1792 | 1800 |
1793 return TRUE; | 1801 return TRUE; |
1794 } | 1802 } |
1795 | 1803 |
1796 /** | 1804 /** |