X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=blobdiff_plain;f=src%2Fplugins%2Fspam_report%2Fspam_report_prefs.c;h=617794a9c6094adf78d8279c1e7e9fa4e6459955;hp=7d0e88d1a5385622149187978f808d1c66370a22;hb=125b18131c0e9f3b1d71e56134380bdbc71e0820;hpb=e727be6329c2589a739f2260bbf164c43701ba77 diff --git a/src/plugins/spam_report/spam_report_prefs.c b/src/plugins/spam_report/spam_report_prefs.c index 7d0e88d1a..617794a9c 100644 --- a/src/plugins/spam_report/spam_report_prefs.c +++ b/src/plugins/spam_report/spam_report_prefs.c @@ -76,6 +76,7 @@ void spamreport_prefs_init(void) { static gchar *path[3]; gchar *rcpath; + guint i; path[0] = _("Plugins"); path[1] = _("SpamReport"); @@ -85,7 +86,16 @@ void spamreport_prefs_init(void) rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL); prefs_read_config(param, PREFS_BLOCK_NAME, rcpath, NULL); g_free(rcpath); - + + /* Move passwords that are still in main config to password store. */ + for (i = 0; i < INTF_LAST; i++) { + if (spamreport_prefs.pass[i] != NULL && + strlen(spamreport_prefs.pass[i]) > 0) { + spamreport_passwd_set(spam_interfaces[i].name, + spamreport_prefs.pass[i]); + } + } + spamreport_prefs_page.page.path = path; spamreport_prefs_page.page.create_widget = create_spamreport_prefs_page; spamreport_prefs_page.page.destroy_widget = destroy_spamreport_prefs_page; @@ -128,7 +138,7 @@ static void create_spamreport_prefs_page(PrefsPage *page, gtk_entry_set_text(GTK_ENTRY(prefs_page->user_entry[i]), spamreport_prefs.user[i] ? spamreport_prefs.user[i]:""); - pass = password_decrypt(spamreport_prefs.pass[i], NULL); + pass = spamreport_passwd_get(spam_interfaces[i].name); gtk_entry_set_text(GTK_ENTRY(prefs_page->pass_entry[i]), pass ? pass:""); if (pass != NULL) { memset(pass, 0, strlen(pass)); @@ -209,8 +219,10 @@ static void save_spamreport_prefs(PrefsPage *page) GTK_EDITABLE(prefs_page->user_entry[i]), 0, -1); pass = gtk_editable_get_chars(GTK_EDITABLE(prefs_page->pass_entry[i]), 0, -1); - spamreport_prefs.pass[i] = password_encrypt(pass, NULL); - memset(pass, 0, strlen(pass)); + if (strlen(pass) > 0) { + spamreport_passwd_set(spam_interfaces[i].name, pass); + memset(pass, 0, strlen(pass)); + } g_free(pass); }