diff libpurple/protocols/novell/novell.c @ 20589:5723dbc6212d

Clear the password consistently when we get a "Signed-On elsewhere" or a "Invalid Password" disconnection. Disconnection reason codes will take care of this in the core, but until then, this is ok. Fixes #3204.
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 21 Sep 2007 02:46:27 +0000
parents 44b4e8bd759b
children 591267f6f1d5 f3cfcbbac3d8 3cc856ca2338
line wrap: on
line diff
--- a/libpurple/protocols/novell/novell.c	Fri Sep 21 01:49:27 2007 +0000
+++ b/libpurple/protocols/novell/novell.c	Fri Sep 21 02:46:27 2007 +0000
@@ -130,6 +130,8 @@
 		if (ret_code == NMERR_AUTHENTICATION_FAILED ||
 			ret_code == NMERR_CREDENTIALS_MISSING ||
 			ret_code == NMERR_PASSWORD_INVALID) {
+			if (!purple_account_get_remember_password(gc->account))
+				purple_account_set_password(gc->account, NULL);
 			gc->wants_to_die = TRUE;
 		}
 		purple_connection_error(gc, err);
@@ -2004,11 +2006,14 @@
 _evt_user_disconnect(NMUser * user, NMEvent * event)
 {
 	PurpleConnection *gc;
-
-	gc = purple_account_get_connection((PurpleAccount *) user->client_data);
+	PurpleAccount *account = user->client_data;
+
+	gc = purple_account_get_connection(account);
 	if (gc)
 	{
 		gc->wants_to_die = TRUE; /* we don't want to reconnect in this case */
+		if (!purple_account_get_remember_password(account))
+			purple_account_set_password(account, NULL);
 		purple_connection_error(gc, _("You have been logged out because you"
 									" logged in at another workstation."));
 	}
@@ -2799,7 +2804,7 @@
 	const char *text = NULL;
 
 	if (buddy == NULL)
-		return; 
+		return;
 
 	gc = purple_account_get_connection(buddy->account);
 	if (gc == NULL || (user = gc->proto_data) == NULL)