We are not guarenteed to have a non-NULL service (ie. PGP) thus check for
2001-07-30 Jeffrey Stedfast <fejj@ximian.com> * mail-mt.c (do_get_pass): We are not guarenteed to have a non-NULL service (ie. PGP) thus check for it. (pass_got): And again here. (mail_get_password): And of course here too. svn path=/trunk/; revision=11493
This commit is contained in:
committed by
Jeffrey Stedfast
parent
61889c3c08
commit
bf408fed06
@ -1,5 +1,10 @@
|
||||
2001-07-30 Jeffrey Stedfast <fejj@ximian.com>
|
||||
|
||||
* mail-mt.c (do_get_pass): We are not guarenteed to have a
|
||||
non-NULL service (ie. PGP) thus check for it.
|
||||
(pass_got): And again here.
|
||||
(mail_get_password): And of course here too.
|
||||
|
||||
* mail-format.c (decode_pgp): When writing out a CamelException to
|
||||
the HTML stream, be sure to translate it first.
|
||||
(handle_message_external_body): Convert to UTF8 here too - I know
|
||||
|
||||
@ -406,21 +406,24 @@ pass_got (char *string, void *data)
|
||||
m->result = g_strdup (string);
|
||||
|
||||
remember = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (m->tb));
|
||||
mca = mail_config_get_account_by_source_url (m->service_url);
|
||||
if (mca)
|
||||
mail_config_service_set_save_passwd (mca->source, remember);
|
||||
else {
|
||||
mca = mail_config_get_account_by_transport_url (m->service_url);
|
||||
if (m->service_url) {
|
||||
mca = mail_config_get_account_by_source_url (m->service_url);
|
||||
if (mca)
|
||||
mail_config_service_set_save_passwd (mca->transport, remember);
|
||||
else
|
||||
printf ("Cannot figure out which account owns URL \"%s\" (could before?)\n", m->service_url);
|
||||
mail_config_service_set_save_passwd (mca->source, remember);
|
||||
else {
|
||||
mca = mail_config_get_account_by_transport_url (m->service_url);
|
||||
if (mca)
|
||||
mail_config_service_set_save_passwd (mca->transport, remember);
|
||||
else
|
||||
printf ("Cannot figure out which account owns URL \"%s\" (could before?)\n",
|
||||
m->service_url);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
do_get_pass(struct _mail_msg *mm)
|
||||
do_get_pass (struct _mail_msg *mm)
|
||||
{
|
||||
struct _pass_msg *m = (struct _pass_msg *)mm;
|
||||
const MailConfigAccount *mca;
|
||||
@ -436,16 +439,18 @@ do_get_pass(struct _mail_msg *mm)
|
||||
tb = gtk_check_button_new_with_label (_("Remember this password"));
|
||||
gtk_widget_show (tb);
|
||||
|
||||
mca = mail_config_get_account_by_source_url (m->service_url);
|
||||
if (mca)
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tb), mca->source->save_passwd);
|
||||
else {
|
||||
mca = mail_config_get_account_by_transport_url (m->service_url);
|
||||
if (m->service_url) {
|
||||
mca = mail_config_get_account_by_source_url (m->service_url);
|
||||
if (mca)
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tb), mca->transport->save_passwd);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tb), mca->source->save_passwd);
|
||||
else {
|
||||
printf ("Cannot figure out which account owns URL \"%s\"\n", m->service_url);
|
||||
gtk_widget_hide (tb);
|
||||
mca = mail_config_get_account_by_transport_url (m->service_url);
|
||||
if (mca)
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tb), mca->transport->save_passwd);
|
||||
else {
|
||||
printf ("Cannot figure out which account owns URL \"%s\"\n", m->service_url);
|
||||
gtk_widget_hide (tb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -514,8 +519,12 @@ mail_get_password (CamelService *service, const char *prompt, gboolean secret)
|
||||
|
||||
m->prompt = prompt;
|
||||
m->secret = secret;
|
||||
m->service_url = camel_url_to_string (service->url,
|
||||
CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS);
|
||||
if (service) {
|
||||
m->service_url = camel_url_to_string (service->url,
|
||||
CAMEL_URL_HIDE_PASSWORD |
|
||||
CAMEL_URL_HIDE_PARAMS);
|
||||
} else
|
||||
m->service_url = NULL;
|
||||
|
||||
if (pthread_self () == mail_gui_thread) {
|
||||
do_get_pass ((struct _mail_msg *)m);
|
||||
|
||||
@ -103,7 +103,7 @@ class_init (MailSessionClass *mail_session_class)
|
||||
{
|
||||
CamelSessionClass *camel_session_class =
|
||||
CAMEL_SESSION_CLASS (mail_session_class);
|
||||
|
||||
|
||||
/* virtual method override */
|
||||
camel_session_class->get_password = get_password;
|
||||
camel_session_class->forget_password = forget_password;
|
||||
@ -117,10 +117,11 @@ static CamelType
|
||||
mail_session_get_type (void)
|
||||
{
|
||||
static CamelType mail_session_type = CAMEL_INVALID_TYPE;
|
||||
|
||||
|
||||
if (mail_session_type == CAMEL_INVALID_TYPE) {
|
||||
mail_session_type = camel_type_register (
|
||||
camel_session_get_type (), "MailSession",
|
||||
camel_session_get_type (),
|
||||
"MailSession",
|
||||
sizeof (MailSession),
|
||||
sizeof (MailSessionClass),
|
||||
(CamelObjectClassInitFunc) class_init,
|
||||
@ -128,7 +129,7 @@ mail_session_get_type (void)
|
||||
(CamelObjectInitFunc) init,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
return mail_session_type;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user