# HG changeset patch # User Luke Schierer # Date 1062811490 0 # Node ID ddbe06989d46911f0097a69434b51ddf4e0162e7 # Parent e7e21e5d1d16ffdedacf6c1178a3372f69b78e61 [gaim-migrate @ 7293] Tim Ringenbach (marv_sf) added better error messages for some yahoo errors committer: Tailor Script diff -r e7e21e5d1d16 -r ddbe06989d46 src/protocols/yahoo/yahoo.c --- a/src/protocols/yahoo/yahoo.c Sat Sep 06 01:21:30 2003 +0000 +++ b/src/protocols/yahoo/yahoo.c Sat Sep 06 01:24:50 2003 +0000 @@ -695,7 +695,7 @@ char *sn = NULL; GSList *l = pkt->hash; struct yahoo_data *yd = gc->proto_data; - + while (l) { struct yahoo_pair *pair = l->data; if (pair->key == 94) @@ -899,6 +899,35 @@ } } +static void yahoo_process_authresp(GaimConnection *gc, struct yahoo_packet *pkt) +{ + GSList *l = pkt->hash; + int err = 0; + char *msg; + + while (l) { + struct yahoo_pair *pair = l->data; + + if (pair->key == 66) + err = strtol(pair->value, NULL, 10); + + l = l->next; + } + + switch (err) { + case 3: + msg = _("Invalid username."); + break; + case 13: + msg = _("Incorrect password."); + break; + default: + msg = _("Unknown error."); + } + + gaim_connection_error(gc, msg); +} + static void yahoo_packet_process(GaimConnection *gc, struct yahoo_packet *pkt) { switch (pkt->service) { @@ -935,6 +964,9 @@ case YAHOO_SERVICE_IGNORECONTACT: yahoo_process_ignore(gc, pkt); break; + case YAHOO_SERVICE_AUTHRESP: + yahoo_process_authresp(gc, pkt); + break; case YAHOO_SERVICE_CONFINVITE: case YAHOO_SERVICE_CONFADDINVITE: yahoo_process_conference_invite(gc, pkt);