comparison libpurple/protocols/simple/simple.c @ 20816:efa448405f3d

Remove explicit setting of wants_to_die from prpls.
author Will Thompson <will.thompson@collabora.co.uk>
date Tue, 09 Oct 2007 13:42:15 +0000
parents f3cfcbbac3d8
children ba41f2a60253
comparison
equal deleted inserted replaced
20815:7a7b3a425666 20816:efa448405f3d
1040 break; 1040 break;
1041 case 401: 1041 case 401:
1042 if(sip->registerstatus != SIMPLE_REGISTER_RETRY) { 1042 if(sip->registerstatus != SIMPLE_REGISTER_RETRY) {
1043 purple_debug_info("simple", "REGISTER retries %d\n", sip->registrar.retries); 1043 purple_debug_info("simple", "REGISTER retries %d\n", sip->registrar.retries);
1044 if(sip->registrar.retries > SIMPLE_REGISTER_RETRY_MAX) { 1044 if(sip->registrar.retries > SIMPLE_REGISTER_RETRY_MAX) {
1045 purple_debug_info("simple", "Setting wants_to_die to true.\n");
1046 sip->gc->wants_to_die = TRUE;
1047 if (!purple_account_get_remember_password(sip->gc->account)) 1045 if (!purple_account_get_remember_password(sip->gc->account))
1048 purple_account_set_password(sip->gc->account, NULL); 1046 purple_account_set_password(sip->gc->account, NULL);
1049 purple_connection_error_reason(sip->gc, 1047 purple_connection_error_reason(sip->gc,
1050 PURPLE_REASON_AUTHENTICATION_FAILED, 1048 PURPLE_REASON_AUTHENTICATION_FAILED,
1051 _("Incorrect password.")); 1049 _("Incorrect password."));
1059 break; 1057 break;
1060 default: 1058 default:
1061 if (sip->registerstatus != SIMPLE_REGISTER_RETRY) { 1059 if (sip->registerstatus != SIMPLE_REGISTER_RETRY) {
1062 purple_debug_info("simple", "Unrecognized return code for REGISTER.\n"); 1060 purple_debug_info("simple", "Unrecognized return code for REGISTER.\n");
1063 if (sip->registrar.retries > SIMPLE_REGISTER_RETRY_MAX) { 1061 if (sip->registrar.retries > SIMPLE_REGISTER_RETRY_MAX) {
1064 sip->gc->wants_to_die = TRUE;
1065 purple_connection_error_reason(sip->gc, PURPLE_REASON_OTHER_ERROR, 1062 purple_connection_error_reason(sip->gc, PURPLE_REASON_OTHER_ERROR,
1066 _("Unknown server response.")); 1063 _("Unknown server response."));
1067 return TRUE; 1064 return TRUE;
1068 } 1065 }
1069 sip->registerstatus = SIMPLE_REGISTER_RETRY; 1066 sip->registerstatus = SIMPLE_REGISTER_RETRY;
1707 1704
1708 const char *username = purple_account_get_username(account); 1705 const char *username = purple_account_get_username(account);
1709 gc = purple_account_get_connection(account); 1706 gc = purple_account_get_connection(account);
1710 1707
1711 if (strpbrk(username, " \t\v\r\n") != NULL) { 1708 if (strpbrk(username, " \t\v\r\n") != NULL) {
1712 gc->wants_to_die = TRUE;
1713 purple_connection_error_reason(gc, PURPLE_REASON_INVALID_SETTINGS, 1709 purple_connection_error_reason(gc, PURPLE_REASON_INVALID_SETTINGS,
1714 _("SIP screen names may not contain whitespaces or @ symbols")); 1710 _("SIP screen names may not contain whitespaces or @ symbols"));
1715 return; 1711 return;
1716 } 1712 }
1717 1713