comparison 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
comparison
equal deleted inserted replaced
20588:e23a1585d822 20589:5723dbc6212d
128 * was invalid. 128 * was invalid.
129 */ 129 */
130 if (ret_code == NMERR_AUTHENTICATION_FAILED || 130 if (ret_code == NMERR_AUTHENTICATION_FAILED ||
131 ret_code == NMERR_CREDENTIALS_MISSING || 131 ret_code == NMERR_CREDENTIALS_MISSING ||
132 ret_code == NMERR_PASSWORD_INVALID) { 132 ret_code == NMERR_PASSWORD_INVALID) {
133 if (!purple_account_get_remember_password(gc->account))
134 purple_account_set_password(gc->account, NULL);
133 gc->wants_to_die = TRUE; 135 gc->wants_to_die = TRUE;
134 } 136 }
135 purple_connection_error(gc, err); 137 purple_connection_error(gc, err);
136 g_free(err); 138 g_free(err);
137 } 139 }
2002 2004
2003 static void 2005 static void
2004 _evt_user_disconnect(NMUser * user, NMEvent * event) 2006 _evt_user_disconnect(NMUser * user, NMEvent * event)
2005 { 2007 {
2006 PurpleConnection *gc; 2008 PurpleConnection *gc;
2007 2009 PurpleAccount *account = user->client_data;
2008 gc = purple_account_get_connection((PurpleAccount *) user->client_data); 2010
2011 gc = purple_account_get_connection(account);
2009 if (gc) 2012 if (gc)
2010 { 2013 {
2011 gc->wants_to_die = TRUE; /* we don't want to reconnect in this case */ 2014 gc->wants_to_die = TRUE; /* we don't want to reconnect in this case */
2015 if (!purple_account_get_remember_password(account))
2016 purple_account_set_password(account, NULL);
2012 purple_connection_error(gc, _("You have been logged out because you" 2017 purple_connection_error(gc, _("You have been logged out because you"
2013 " logged in at another workstation.")); 2018 " logged in at another workstation."));
2014 } 2019 }
2015 } 2020 }
2016 2021
2797 int status = 0; 2802 int status = 0;
2798 const char *status_str = NULL; 2803 const char *status_str = NULL;
2799 const char *text = NULL; 2804 const char *text = NULL;
2800 2805
2801 if (buddy == NULL) 2806 if (buddy == NULL)
2802 return; 2807 return;
2803 2808
2804 gc = purple_account_get_connection(buddy->account); 2809 gc = purple_account_get_connection(buddy->account);
2805 if (gc == NULL || (user = gc->proto_data) == NULL) 2810 if (gc == NULL || (user = gc->proto_data) == NULL)
2806 return; 2811 return;
2807 2812