Clear the password when we get an auth. error and we're not saving passwords so that you don't need to go into the account settings to reset it. Fix #3083.

Fri, 14 Sep 2007 00:03:30 +0000

author
Daniel Atallah <datallah@pidgin.im>
date
Fri, 14 Sep 2007 00:03:30 +0000
changeset 19993
867bd1dfe680
parent 19992
3cdb4f27fb7c
child 19994
854d2a4c99b6

Clear the password when we get an auth. error and we're not saving passwords so that you don't need to go into the account settings to reset it. Fix #3083.

libpurple/protocols/jabber/auth.c file | annotate | diff | comparison | revisions
libpurple/protocols/jabber/jabber.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/jabber/auth.c	Fri Sep 14 00:01:47 2007 +0000
+++ b/libpurple/protocols/jabber/auth.c	Fri Sep 14 00:03:30 2007 +0000
@@ -538,6 +538,9 @@
 					(err_code = xmlnode_get_attrib(error, "code")) &&
 					!strcmp(err_code, "401")) {
 			js->gc->wants_to_die = TRUE;
+			/* Clear the pasword if it isn't being saved */
+			if (!purple_account_get_remember_password(js->gc->account))
+				purple_account_set_password(js->gc->account, NULL);
 		}
 
 		purple_connection_error(js->gc, msg);
--- a/libpurple/protocols/jabber/jabber.c	Fri Sep 14 00:01:47 2007 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Fri Sep 14 00:03:30 2007 +0000
@@ -458,7 +458,7 @@
 	if(!PURPLE_CONNECTION_IS_VALID(gc)) {
 		purple_ssl_close(gsc);
 		return;
-	}	
+	}
 
 	js = gc->proto_data;
 
@@ -1731,7 +1731,7 @@
 			_("Change XMPP Password"), _("Please enter your new password"),
 			fields, _("OK"), G_CALLBACK(jabber_password_change_cb),
 			_("Cancel"), NULL,
-			purple_connection_get_account(gc), NULL, NULL,			  
+			purple_connection_get_account(gc), NULL, NULL,
 			js);
 }
 
@@ -1899,6 +1899,9 @@
 			text = _("Authorization mechanism too weak");
 		} else if(xmlnode_get_child(packet, "not-authorized")) {
 			js->gc->wants_to_die = TRUE;
+			/* Clear the pasword if it isn't being saved */
+			if (!purple_account_get_remember_password(js->gc->account))
+				purple_account_set_password(js->gc->account, NULL);
 			text = _("Not Authorized");
 		} else if(xmlnode_get_child(packet, "temporary-auth-failure")) {
 			text = _("Temporary Authentication Failure");

mercurial