summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Bailey <rekkanoryo@rekkanoryo.org>2009-06-19 21:10:02 +0000
committerJohn Bailey <rekkanoryo@rekkanoryo.org>2009-06-19 21:10:02 +0000
commit2694769a5a2a1a006525a17f35d3ccd81f0cc4fc (patch)
treeaeadc540998b0157b234b30151f3a4c5c1c6e0b7
parent5f4cd97267299964962281ed4fcffa6b0918f4d6 (diff)
downloadpidgin-2694769a5a2a1a006525a17f35d3ccd81f0cc4fc.tar.gz
*** Plucked rev cdbf018a5ef98397e81d541269550d9c6fded457 (sulabh@soc.pidgin.im):
Set yahoo to connected after processing the buddy list, should help get rid of the bug reported by the adium user *** Plucked rev 3952ed728efd23f39d502201b828c86acf6dffd2 (sulabh@soc.pidgin.im): yahoo login ver 16: Add another case of error reporting. Ask user to visit yahoo website in case of locked account.
-rw-r--r--libpurple/protocols/yahoo/yahoo.c42
1 files changed, 16 insertions, 26 deletions
diff --git a/libpurple/protocols/yahoo/yahoo.c b/libpurple/protocols/yahoo/yahoo.c
index d40e865519..f8388e37d6 100644
--- a/libpurple/protocols/yahoo/yahoo.c
+++ b/libpurple/protocols/yahoo/yahoo.c
@@ -145,7 +145,6 @@ static void yahoo_update_status(PurpleConnection *gc, const char *name, YahooFri
static void yahoo_process_status(PurpleConnection *gc, struct yahoo_packet *pkt)
{
PurpleAccount *account = purple_connection_get_account(gc);
- struct yahoo_data *yd = gc->proto_data;
GSList *l = pkt->hash;
YahooFriend *f = NULL;
char *name = NULL;
@@ -165,29 +164,7 @@ static void yahoo_process_status(PurpleConnection *gc, struct yahoo_packet *pkt)
switch (pair->key) {
case 0: /* we won't actually do anything with this */
- break;
- case 1: /* we don't get the full buddy list here. */
- if (!yd->logged_in) {
- purple_connection_set_display_name(gc, pair->value);
- purple_connection_set_state(gc, PURPLE_CONNECTED);
- yd->logged_in = TRUE;
- if (yd->picture_upload_todo) {
- yahoo_buddy_icon_upload(gc, yd->picture_upload_todo);
- yd->picture_upload_todo = NULL;
- }
- yahoo_set_status(account, purple_account_get_active_status(account));
-
- /* this requests the list. i have a feeling that this is very evil
- *
- * scs.yahoo.com sends you the list before this packet without it being
- * requested
- *
- * do_import(gc, NULL);
- * newpkt = yahoo_packet_new(YAHOO_SERVICE_LIST, YAHOO_STATUS_OFFLINE, 0);
- * yahoo_packet_send_and_free(newpkt, yd);
- */
-
- }
+ case 1: /* we won't actually do anything with this */
break;
case 8: /* how many online buddies we have */
break;
@@ -547,6 +524,18 @@ static void yahoo_process_list_15(PurpleConnection *gc, struct yahoo_packet *pkt
}
g_hash_table_foreach(ht, yahoo_do_group_cleanup, NULL);
+
+ /* Now that we have processed the buddy list, we can say yahoo has connected */
+ purple_connection_set_display_name(gc, purple_normalize(account, purple_account_get_username(account)));
+ purple_connection_set_state(gc, PURPLE_CONNECTED);
+ yd->logged_in = TRUE;
+ if (yd->picture_upload_todo) {
+ yahoo_buddy_icon_upload(gc, yd->picture_upload_todo);
+ yd->picture_upload_todo = NULL;
+ }
+ yahoo_set_status(account, purple_account_get_active_status(account));
+ purple_debug_info("yahoo","Authentication: Connection established\n");
+
g_hash_table_destroy(ht);
g_free(norm_bud);
}
@@ -1565,7 +1554,7 @@ static void yahoo_auth16_stage1_cb(PurpleUtilFetchUrlData *unused, gpointer user
break;
case 1213:
/* security lock from too many failed login attempts */
- error_reason = g_strdup(_("Account locked: Too many failed login attempts"));
+ error_reason = g_strdup(_("Account locked: Too many failed login attempts.\nLogging into the Yahoo! website may fix this."));
error = PURPLE_CONNECTION_ERROR_OTHER_ERROR;
break;
case 1235:
@@ -1573,9 +1562,10 @@ static void yahoo_auth16_stage1_cb(PurpleUtilFetchUrlData *unused, gpointer user
error_reason = g_strdup(_("Username does not exist"));
error = PURPLE_CONNECTION_ERROR_INVALID_USERNAME;
break;
+ case 1214:
case 1236:
/* indicates a lock of some description */
- error_reason = g_strdup(_("Account locked: See the debug log"));
+ error_reason = g_strdup(_("Account locked: Unknown reason.\nLogging into the Yahoo! website may fix this."));
error = PURPLE_CONNECTION_ERROR_OTHER_ERROR;
break;
case 100: