# HG changeset patch # User Will Thompson # Date 1191345376 0 # Node ID 57e9d1ecefff9caece52c6c078212027e6698ef2 # Parent a4fda4159937df95114b90bd9a2a959ed292cba7 Rename PURPLE_REASON_INVALID_USERNAME to PURPLE_REASON_INVALID_SETTINGS, so it can be used when a server parameter is required but not supplied (for example). diff -r a4fda4159937 -r 57e9d1ecefff libpurple/connection.h --- a/libpurple/connection.h Tue Oct 02 15:57:32 2007 +0000 +++ b/libpurple/connection.h Tue Oct 02 17:16:16 2007 +0000 @@ -79,12 +79,16 @@ */ PURPLE_REASON_NAME_IN_USE, - /** The username for the account isn't valid. + /** The username/server/other preference for the account isn't valid. + * For instance, on IRC the screen name cannot contain white space. + * This reason should not be used for incorrect passwords etc: use + * #PURPLE_REASON_AUTHENTICATION_FAILED for that. + * * @todo This reason really shouldn't be necessary. Usernames and * other account preferences should be validated when the * account is created. */ - PURPLE_REASON_INVALID_USERNAME, + PURPLE_REASON_INVALID_SETTINGS, /** The server did not provide a SSL certificate. */ PURPLE_REASON_CERT_NOT_PROVIDED, diff -r a4fda4159937 -r 57e9d1ecefff libpurple/protocols/irc/irc.c --- a/libpurple/protocols/irc/irc.c Tue Oct 02 15:57:32 2007 +0000 +++ b/libpurple/protocols/irc/irc.c Tue Oct 02 17:16:16 2007 +0000 @@ -297,7 +297,7 @@ gc->flags |= PURPLE_CONNECTION_NO_NEWLINES; if (strpbrk(username, " \t\v\r\n") != NULL) { - purple_connection_error_reason (gc, PURPLE_REASON_INVALID_USERNAME, + purple_connection_error_reason (gc, PURPLE_REASON_INVALID_SETTINGS, _("IRC nicks may not contain whitespace")); return; } diff -r a4fda4159937 -r 57e9d1ecefff libpurple/protocols/irc/msgs.c --- a/libpurple/protocols/irc/msgs.c Tue Oct 02 15:57:32 2007 +0000 +++ b/libpurple/protocols/irc/msgs.c Tue Oct 02 17:16:16 2007 +0000 @@ -911,7 +911,7 @@ } else { gc->wants_to_die = TRUE; - purple_connection_error_reason (gc, PURPLE_REASON_INVALID_USERNAME, + purple_connection_error_reason (gc, PURPLE_REASON_INVALID_SETTINGS, _("Your selected account name was rejected by the server. It probably contains invalid characters.")); } } diff -r a4fda4159937 -r 57e9d1ecefff libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Tue Oct 02 15:57:32 2007 +0000 +++ b/libpurple/protocols/jabber/jabber.c Tue Oct 02 17:16:16 2007 +0000 @@ -588,13 +588,13 @@ js->old_length = -1; if(!js->user) { - purple_connection_error_reason (gc, PURPLE_REASON_INVALID_USERNAME, + purple_connection_error_reason (gc, PURPLE_REASON_INVALID_SETTINGS, _("Invalid XMPP ID")); return; } if (!js->user->domain || *(js->user->domain) == '\0') { - purple_connection_error_reason (gc, PURPLE_REASON_INVALID_USERNAME, + purple_connection_error_reason (gc, PURPLE_REASON_INVALID_SETTINGS, _("Invalid XMPP ID. Domain must be set.")); return; } @@ -1079,7 +1079,7 @@ js->old_length = -1; if(!js->user) { - purple_connection_error_reason (gc, PURPLE_REASON_INVALID_USERNAME, + purple_connection_error_reason (gc, PURPLE_REASON_INVALID_SETTINGS, _("Invalid XMPP ID")); return; } diff -r a4fda4159937 -r 57e9d1ecefff libpurple/protocols/sametime/sametime.c --- a/libpurple/protocols/sametime/sametime.c Tue Oct 02 15:57:32 2007 +0000 +++ b/libpurple/protocols/sametime/sametime.c Tue Oct 02 17:16:16 2007 +0000 @@ -3646,7 +3646,7 @@ static void prompt_host_cancel_cb(PurpleConnection *gc) { const char *msg = _("No Sametime Community Server specified"); - purple_connection_error_reason(gc, PURPLE_REASON_INVALID_USERNAME, msg); + purple_connection_error_reason(gc, PURPLE_REASON_INVALID_SETTINGS, msg); }