Fix bug #2975: Implement setting -0000 timezone to hide sender localtime
[claws.git] / src / news.c
index fdcea333543dc1572f1af650aad8ddde0f551b7c..5081a0e369c319918fa3e10a230fcaa64fd75904 100644 (file)
@@ -48,6 +48,7 @@
 #include "statusbar.h"
 #include "codeconv.h"
 #include "utils.h"
+#include "passwordstore.h"
 #include "prefs_common.h"
 #include "prefs_account.h"
 #include "inputdialog.h"
@@ -404,12 +405,12 @@ static Session *news_session_new_for_folder(Folder *folder)
                userid = ac->userid;
                if (password_get(userid, ac->nntp_server, "nntp", port, &passwd)) {
                        /* NOP */;
-               } else if (ac->passwd && ac->passwd[0])
-                       passwd = g_strdup(ac->passwd);
-               else
+               } else if ((passwd = passwd_store_get_account(ac->account_id,
+                                       PWS_ACCOUNT_RECV)) == NULL) {
                        passwd = input_dialog_query_password_keep(ac->nntp_server,
                                                                  userid,
                                                                  &(ac->session_passwd));
+               }
        }
 
        if (session != NULL)
@@ -944,7 +945,10 @@ gint news_cancel_article(Folder * folder, MsgInfo * msginfo)
                g_warning("can't change file mode");
        }
        
-       get_rfc822_date(buf, sizeof(buf));
+       if (prefs_common.hide_timezone)
+               get_rfc822_date_hide_tz(buf, sizeof(buf));
+       else
+               get_rfc822_date(buf, sizeof(buf));
        if (fprintf(tmpfp, "From: %s\r\n"
                       "Newsgroups: %s\r\n"
                       "Subject: cmsg cancel <%s>\r\n"
@@ -1445,7 +1449,7 @@ static void warn_etpan(void)
                        _("You have one or more News accounts "
                          "defined. However this version of "
                          "Claws Mail has been built without "
-                         "News support; your News account(s) are "
+                         "News support; your News accounts are "
                          "disabled.\n\n"
                          "You probably need to "
                          "install libetpan and recompile "