Mercurial > pidgin.yaz
comparison libpurple/protocols/oscar/oscar.c @ 27463:f541583e31bd
More uniformity among disconnect error messages
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 06 Jul 2009 09:07:42 +0000 |
parents | 714f9352e844 |
children | ecf2dec4ef5e |
comparison
equal
deleted
inserted
replaced
27462:1bbed9fd046b | 27463:f541583e31bd |
---|---|
1109 | 1109 |
1110 if (conn->type == SNAC_FAMILY_AUTH) | 1110 if (conn->type == SNAC_FAMILY_AUTH) |
1111 { | 1111 { |
1112 /* This only happens when connecting with the old-style BUCP login */ | 1112 /* This only happens when connecting with the old-style BUCP login */ |
1113 gchar *msg; | 1113 gchar *msg; |
1114 msg = g_strdup_printf(_("Could not connect to authentication server:\n%s"), | 1114 msg = g_strdup_printf(_("Unable to connect to authentication server: %s"), |
1115 error_message); | 1115 error_message); |
1116 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg); | 1116 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg); |
1117 g_free(msg); | 1117 g_free(msg); |
1118 } | 1118 } |
1119 else if (conn->type == SNAC_FAMILY_LOCATE) | 1119 else if (conn->type == SNAC_FAMILY_LOCATE) |
1120 { | 1120 { |
1121 gchar *msg; | 1121 gchar *msg; |
1122 msg = g_strdup_printf(_("Could not connect to BOS server:\n%s"), | 1122 msg = g_strdup_printf(_("Unable to connect to BOS server: %s"), |
1123 error_message); | 1123 error_message); |
1124 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg); | 1124 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg); |
1125 g_free(msg); | 1125 g_free(msg); |
1126 } | 1126 } |
1127 else | 1127 else |
1519 | 1519 |
1520 purple_debug_misc("oscar", "oscar_login: gc = %p\n", gc); | 1520 purple_debug_misc("oscar", "oscar_login: gc = %p\n", gc); |
1521 | 1521 |
1522 if (!oscar_util_valid_name(purple_account_get_username(account))) { | 1522 if (!oscar_util_valid_name(purple_account_get_username(account))) { |
1523 gchar *buf; | 1523 gchar *buf; |
1524 buf = g_strdup_printf(_("Unable to login: Could not sign on as %s because the username is invalid. Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), purple_account_get_username(account)); | 1524 buf = g_strdup_printf(_("Unable to sign on as %s because the username is invalid. Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), purple_account_get_username(account)); |
1525 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, buf); | 1525 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, buf); |
1526 g_free(buf); | 1526 g_free(buf); |
1527 return; | 1527 return; |
1528 } | 1528 } |
1529 | 1529 |
1603 connection_established_cb, newconn); | 1603 connection_established_cb, newconn); |
1604 } | 1604 } |
1605 | 1605 |
1606 if (newconn->gsc == NULL && newconn->connect_data == NULL) { | 1606 if (newconn->gsc == NULL && newconn->connect_data == NULL) { |
1607 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, | 1607 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
1608 _("Couldn't connect to host")); | 1608 _("Unable to connect")); |
1609 return; | 1609 return; |
1610 } | 1610 } |
1611 } | 1611 } |
1612 | 1612 |
1613 purple_connection_update_progress(gc, _("Connecting"), 0, OSCAR_CONNECT_STEPS); | 1613 purple_connection_update_progress(gc, _("Connecting"), 0, OSCAR_CONNECT_STEPS); |
1839 conn->connect_data = purple_proxy_connect(NULL, | 1839 conn->connect_data = purple_proxy_connect(NULL, |
1840 purple_connection_get_account(gc), host, port, | 1840 purple_connection_get_account(gc), host, port, |
1841 connection_established_cb, conn); | 1841 connection_established_cb, conn); |
1842 if (conn->connect_data == NULL) | 1842 if (conn->connect_data == NULL) |
1843 { | 1843 { |
1844 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Could Not Connect")); | 1844 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect")); |
1845 return 0; | 1845 return 0; |
1846 } | 1846 } |
1847 | 1847 |
1848 od->default_port = port; | 1848 od->default_port = port; |
1849 | 1849 |
1885 break; | 1885 break; |
1886 case 0x05: | 1886 case 0x05: |
1887 /* Incorrect password */ | 1887 /* Incorrect password */ |
1888 if (!purple_account_get_remember_password(account)) | 1888 if (!purple_account_get_remember_password(account)) |
1889 purple_account_set_password(account, NULL); | 1889 purple_account_set_password(account, NULL); |
1890 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Incorrect password.")); | 1890 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Incorrect password")); |
1891 break; | 1891 break; |
1892 case 0x11: | 1892 case 0x11: |
1893 /* Suspended account */ | 1893 /* Suspended account */ |
1894 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Your account is currently suspended.")); | 1894 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Your account is currently suspended")); |
1895 break; | 1895 break; |
1896 case 0x02: | 1896 case 0x02: |
1897 case 0x14: | 1897 case 0x14: |
1898 /* service temporarily unavailable */ | 1898 /* service temporarily unavailable */ |
1899 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("The AOL Instant Messenger service is temporarily unavailable.")); | 1899 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("The AOL Instant Messenger service is temporarily unavailable.")); |
1961 } | 1961 } |
1962 | 1962 |
1963 g_free(host); | 1963 g_free(host); |
1964 if (newconn->connect_data == NULL) | 1964 if (newconn->connect_data == NULL) |
1965 { | 1965 { |
1966 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Could Not Connect")); | 1966 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect")); |
1967 return 0; | 1967 return 0; |
1968 } | 1968 } |
1969 | 1969 |
1970 purple_connection_update_progress(gc, _("Received authorization"), 3, OSCAR_CONNECT_STEPS); | 1970 purple_connection_update_progress(gc, _("Received authorization"), 3, OSCAR_CONNECT_STEPS); |
1971 ck[3] = 0x64; | 1971 ck[3] = 0x64; |
1994 PurpleConnection *gc = user_data; | 1994 PurpleConnection *gc = user_data; |
1995 | 1995 |
1996 /* Disconnect */ | 1996 /* Disconnect */ |
1997 purple_connection_error_reason(gc, | 1997 purple_connection_error_reason(gc, |
1998 PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, | 1998 PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, |
1999 _("The SecurID key entered is invalid.")); | 1999 _("The SecurID key entered is invalid")); |
2000 } | 2000 } |
2001 | 2001 |
2002 /** | 2002 /** |
2003 * Only used when connecting with the old-style BUCP login. | 2003 * Only used when connecting with the old-style BUCP login. |
2004 */ | 2004 */ |
4974 bname = purple_buddy_get_name(buddy); | 4974 bname = purple_buddy_get_name(buddy); |
4975 gname = purple_group_get_name(group); | 4975 gname = purple_group_get_name(group); |
4976 | 4976 |
4977 if (!oscar_util_valid_name(bname)) { | 4977 if (!oscar_util_valid_name(bname)) { |
4978 gchar *buf; | 4978 gchar *buf; |
4979 buf = g_strdup_printf(_("Could not add the buddy %s because the username is invalid. Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), bname); | 4979 buf = g_strdup_printf(_("Unable to add the buddy %s because the username is invalid. Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), bname); |
4980 if (!purple_conv_present_error(bname, account, buf)) | 4980 if (!purple_conv_present_error(bname, account, buf)) |
4981 purple_notify_error(gc, NULL, _("Unable to Add"), buf); | 4981 purple_notify_error(gc, NULL, _("Unable to Add"), buf); |
4982 g_free(buf); | 4982 g_free(buf); |
4983 | 4983 |
4984 /* Remove from local list */ | 4984 /* Remove from local list */ |
5459 case 0x0000: { /* added successfully */ | 5459 case 0x0000: { /* added successfully */ |
5460 } break; | 5460 } break; |
5461 | 5461 |
5462 case 0x000c: { /* you are over the limit, the cheat is to the limit, come on fhqwhgads */ | 5462 case 0x000c: { /* you are over the limit, the cheat is to the limit, come on fhqwhgads */ |
5463 gchar *buf; | 5463 gchar *buf; |
5464 buf = g_strdup_printf(_("Could not add the buddy %s because you have too many buddies in your buddy list. Please remove one and try again."), (retval->name ? retval->name : _("(no name)"))); | 5464 buf = g_strdup_printf(_("Unable to add the buddy %s because you have too many buddies in your buddy list. Please remove one and try again."), (retval->name ? retval->name : _("(no name)"))); |
5465 if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) | 5465 if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) |
5466 purple_notify_error(gc, NULL, _("Unable to Add"), buf); | 5466 purple_notify_error(gc, NULL, _("Unable to Add"), buf); |
5467 g_free(buf); | 5467 g_free(buf); |
5468 } | 5468 } |
5469 | 5469 |
5473 } break; | 5473 } break; |
5474 | 5474 |
5475 default: { /* La la la */ | 5475 default: { /* La la la */ |
5476 gchar *buf; | 5476 gchar *buf; |
5477 purple_debug_error("oscar", "ssi: Action 0x%04hx was unsuccessful with error 0x%04hx\n", retval->action, retval->ack); | 5477 purple_debug_error("oscar", "ssi: Action 0x%04hx was unsuccessful with error 0x%04hx\n", retval->action, retval->ack); |
5478 buf = g_strdup_printf(_("Could not add the buddy %s for an unknown reason."), | 5478 buf = g_strdup_printf(_("Unable to add the buddy %s for an unknown reason."), |
5479 (retval->name ? retval->name : _("(no name)"))); | 5479 (retval->name ? retval->name : _("(no name)"))); |
5480 if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) | 5480 if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) |
5481 purple_notify_error(gc, NULL, _("Unable to Add"), buf); | 5481 purple_notify_error(gc, NULL, _("Unable to Add"), buf); |
5482 g_free(buf); | 5482 g_free(buf); |
5483 } break; | 5483 } break; |