Merge branch 'master' of ssh+git://git.claws-mail.org/home/git/claws
authorMichael Rasmussen <mir@datanom.net>
Sat, 26 Aug 2017 21:56:30 +0000 (23:56 +0200)
committerMichael Rasmussen <mir@datanom.net>
Sat, 26 Aug 2017 21:56:30 +0000 (23:56 +0200)
AUTHORS
configure.ac
src/gtk/authors.h
src/imap.c

diff --git a/AUTHORS b/AUTHORS
index a387e3f481e7189dd9d1e3068a4b1890f08430a6..bc4c8dbed4502db36e3ecdd3b9b80fd1cee9a612 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -313,3 +313,4 @@ contributors (in addition to the above; based on Changelog)
        Ashish Gupta
        Olivier Brunel
        Michael Vilain
+       Orbea
index 682e71dbe2ccc8cf31644fd36f5f30621148dea4..9e4933e9f833a91ba6cf4d42eb437ec60c27515d 100644 (file)
@@ -1174,7 +1174,7 @@ AC_SUBST(ARCHIVE_CFLAGS)
 AC_CHECK_LIB([archive], [archive_read_new],
                       ARCHIVE_LIBS=-larchive
                       HAVE_ARCHIVE=yes
-                      AC_SUBST(ARCHIVE_LIBS,ARCHIVE_CFLAGS),
+                      AC_SUBST(ARCHIVE_LIBS,$ARCHIVE_CFLAGS),
                       HAVE_ARCHIVE=no
                       )
 
@@ -1222,10 +1222,10 @@ if test x"$HAVE_PERL" = xyes; then
        AC_MSG_CHECKING(for Perl compile flags)
        PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
        PERL_CFLAGS=`echo $PERL_CFLAGS | sed 's/-D_FILE_OFFSET_BITS=[[0-9]]*//'`
-       PERL_LDFLAGS=`perl -MExtUtils::Embed -e ldopts |sed 's/-lgdbm//'`
-       PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-ldb//'`
-       PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lndbm//'`
-       PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lc//'`
+       PERL_LDFLAGS=`perl -MExtUtils::Embed -e ldopts |sed 's/-lgdbm\>//'`
+       PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-ldb\>//'`
+       PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lndbm\>//'`
+       PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lc\>//'`
        AC_MSG_RESULT(ok)
        AC_MSG_NOTICE([Adding perl LIBS ${PERL_CFLAGS}])
        
index 7f8c09c09803060a5b8ae189547abe7fa7aa1665..b6b7cf700afe571b4dc3f6942b397cfc8d227da4 100644 (file)
@@ -240,6 +240,7 @@ static char *CONTRIBS_LIST[] = {
 "Miquel Oliete",
 "Paul Ollis",
 "Fredrik Olofssen",
+"Orbea",
 "Reza Pakdel",
 "Richard Palo",
 "Marcel Pol",
index 0e1e777aa6744c5c9c19fc456606a4d253bce473..25bb2832f3e0e711d653126b6ef749b15fdddf6a 100644 (file)
@@ -77,6 +77,8 @@ typedef struct _IMAPSession   IMAPSession;
 typedef struct _IMAPNameSpace  IMAPNameSpace;
 typedef struct _IMAPFolderItem IMAPFolderItem;
 
+#include "prefs_account.h"
+
 #define IMAP_FOLDER(obj)       ((IMAPFolder *)obj)
 #define IMAP_FOLDER_ITEM(obj)  ((IMAPFolderItem *)obj)
 #define IMAP_SESSION(obj)      ((IMAPSession *)obj)
@@ -425,6 +427,7 @@ static gint imap_get_flags                  (Folder         *folder,
                                                 FolderItem     *item,
                                                 MsgInfoList    *msglist,
                                                 GHashTable     *msgflags);
+static gchar *imap_folder_get_path             (Folder         *folder);
 static gchar *imap_item_get_path               (Folder         *folder,
                                                 FolderItem     *item);
 static MsgInfo *imap_parse_msg(const gchar *file, FolderItem *item);
@@ -3042,6 +3045,35 @@ static FolderItem *imap_create_special_folder(Folder *folder,
        return new_item;
 }
 
+static gchar *imap_folder_get_path(Folder *folder)
+{
+       gchar *folder_path;
+
+       g_return_val_if_fail(folder != NULL, NULL);
+        g_return_val_if_fail(folder->account != NULL, NULL);
+
+#ifdef G_OS_WIN32
+       gchar *sanitized_dirname = g_strdup(folder->account->recv_server);
+       g_strdelimit(sanitized_dirname, ":", ',');
+#endif
+
+        folder_path = g_strconcat(get_imap_cache_dir(),
+                                  G_DIR_SEPARATOR_S,
+#ifdef G_OS_WIN32
+                                                                                                                                       sanitized_dirname,
+#else
+                                  folder->account->recv_server,
+#endif
+                                  G_DIR_SEPARATOR_S,
+                                  folder->account->userid,
+                                  NULL);
+
+#ifdef G_OS_WIN32
+       g_free(sanitized_dirname);
+#endif
+       return folder_path;
+}
+
 #ifdef G_OS_WIN32
 static gchar *imap_encode_unsafe_chars(const gchar *str)
 {
@@ -3078,9 +3110,8 @@ static gchar *imap_item_get_path(Folder *folder, FolderItem *item)
        gchar *item_path = NULL;
        
        g_return_val_if_fail(folder != NULL, NULL);
-       g_return_val_if_fail(folder->account != NULL, NULL);
        g_return_val_if_fail(item != NULL, NULL);
-       folder_path = prefs_account_cache_dir(folder->account, FALSE);
+       folder_path = imap_folder_get_path(folder);
 
        g_return_val_if_fail(folder_path != NULL, NULL);