[Commits] [SCM] claws branch, master, updated. 3.11.1-172-g3117fda

ticho at claws-mail.org ticho at claws-mail.org
Thu Jun 25 15:32:47 CEST 2015


The branch, master has been updated
       via  3117fda50fcdd9cb79114b6abd3cad92950b0307 (commit)
       via  53784ce94392fbd91b43791f44f63ce6124f5d9b (commit)
      from  4e7e4f922c52439c1212cd1de813a0a9ca9d3691 (commit)

Summary of changes:
 src/imap.c                     |    1 +
 src/plugins/perl/perl_plugin.c |    6 +++++-
 src/procmsg.c                  |    5 +++++
 src/procmsg.h                  |    5 ++++-
 4 files changed, 15 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit 3117fda50fcdd9cb79114b6abd3cad92950b0307
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Jun 25 14:00:31 2015 +0200

    Do not use MsgInfo's plaintext_file for message file.
    
    It is no longer needed, as we no longer write unencrypted
    version of an encrypted message anywhere.
    Keep the struct member for now, since att_remover plugin is
    still (mis)using it.

diff --git a/src/procmsg.c b/src/procmsg.c
index 5ff5f4d..1f0a8b9 100644
--- a/src/procmsg.c
+++ b/src/procmsg.c
@@ -402,17 +402,9 @@ next_folder:
 
 gchar *procmsg_get_message_file_path(MsgInfo *msginfo)
 {
-	gchar *file;
-
 	cm_return_val_if_fail(msginfo != NULL, NULL);
 
-	if (msginfo->plaintext_file)
-		file = g_strdup(msginfo->plaintext_file);
-	else {
-		file = folder_item_fetch_msg(msginfo->folder, msginfo->msgnum);
-	}
-
-	return file;
+	return folder_item_fetch_msg(msginfo->folder, msginfo->msgnum);
 }
 
 gchar *procmsg_get_message_file(MsgInfo *msginfo)

commit 53784ce94392fbd91b43791f44f63ce6124f5d9b
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Jun 25 13:58:21 2015 +0200

    Revert "Remove plaintext_file member of struct MsgInfo."
    
    This reverts commit 4e7e4f922c52439c1212cd1de813a0a9ca9d3691.
    Looks like plaintext_file has been misappropriated by
    att_remover plugin, and it can't be trivially changed.

diff --git a/src/imap.c b/src/imap.c
index ea11e0b..606da64 100644
--- a/src/imap.c
+++ b/src/imap.c
@@ -4649,6 +4649,7 @@ static MsgInfo *imap_parse_msg(const gchar *file, FolderItem *item)
 	msginfo = procheader_parse_file(file, flags, FALSE, FALSE);
 	if (!msginfo) return NULL;
 	
+	msginfo->plaintext_file = g_strdup(file);
 	msginfo->folder = item;
 
 	return msginfo;
diff --git a/src/plugins/perl/perl_plugin.c b/src/plugins/perl/perl_plugin.c
index 1a62615..6db4c41 100644
--- a/src/plugins/perl/perl_plugin.c
+++ b/src/plugins/perl/perl_plugin.c
@@ -542,7 +542,7 @@ static XS(XS_ClawsMail_filter_init)
    *         14 references
    *         15 score
    *         16 not used anymore
-   *         17 not used anymore
+   *         17 plaintext_file
    *         18 not used anymore
    *         19 hidden
    *         20 message file path
@@ -607,6 +607,9 @@ static XS(XS_ClawsMail_filter_init)
     ii ? XSRETURN(ii) : XSRETURN_UNDEF;
   case 15:
     msginfo->score      ? XSRETURN_IV(msginfo->score)      : XSRETURN_UNDEF;
+  case 17:
+    msginfo->plaintext_file ?
+      XSRETURN_PV(msginfo->plaintext_file)                 : XSRETURN_UNDEF;
   case 19:
     msginfo->hidden     ? XSRETURN_IV(msginfo->hidden)     : XSRETURN_UNDEF;
   case 20:
@@ -1934,6 +1937,7 @@ static int perl_init(void)
 "                   ClawsMail::C::filter_init(13));\n"
 "    add_header_entries_(\"references\",ClawsMail::C::filter_init(14));\n"
 "    $msginfo{\"score\"}              = ClawsMail::C::filter_init(15);\n"
+"    $msginfo{\"plaintext_file\"}     = ClawsMail::C::filter_init(17);\n"
 "    $msginfo{\"hidden\"}             = ClawsMail::C::filter_init(19);\n"
 "    $msginfo{\"filepath\"}           = ClawsMail::C::filter_init(20);\n"
 "    $msginfo{\"partial_recv\"}       = ClawsMail::C::filter_init(21);\n"
diff --git a/src/procmsg.c b/src/procmsg.c
index a398b64..5ff5f4d 100644
--- a/src/procmsg.c
+++ b/src/procmsg.c
@@ -402,8 +402,17 @@ next_folder:
 
 gchar *procmsg_get_message_file_path(MsgInfo *msginfo)
 {
+	gchar *file;
+
 	cm_return_val_if_fail(msginfo != NULL, NULL);
-	return folder_item_fetch_msg(msginfo->folder, msginfo->msgnum);
+
+	if (msginfo->plaintext_file)
+		file = g_strdup(msginfo->plaintext_file);
+	else {
+		file = folder_item_fetch_msg(msginfo->folder, msginfo->msgnum);
+	}
+
+	return file;
 }
 
 gchar *procmsg_get_message_file(MsgInfo *msginfo)
@@ -1286,6 +1295,7 @@ MsgInfo *procmsg_msginfo_copy(MsgInfo *msginfo)
         newmsginfo->references = g_slist_reverse(newmsginfo->references);
 
 	MEMBCOPY(score);
+	MEMBDUP(plaintext_file);
 
 	return newmsginfo;
 }
@@ -1422,6 +1432,8 @@ void procmsg_msginfo_free(MsgInfo *msginfo)
 	slist_free_strings_full(msginfo->references);
 	g_slist_free(msginfo->tags);
 
+	g_free(msginfo->plaintext_file);
+
 	g_free(msginfo);
 }
 
@@ -2339,6 +2351,7 @@ MsgInfo *procmsg_msginfo_new_from_mimeinfo(MsgInfo *src_msginfo, MimeInfo *mimei
 	if (tmp_msginfo != NULL) {
 		if (src_msginfo)
 			tmp_msginfo->folder = src_msginfo->folder;
+		tmp_msginfo->plaintext_file = g_strdup(tmpfile);
 	} else {
 		g_warning("procmsg_msginfo_new_from_mimeinfo(): Can't generate new msginfo");
 	}
diff --git a/src/procmsg.h b/src/procmsg.h
index e5e4bf2..5152c05 100644
--- a/src/procmsg.h
+++ b/src/procmsg.h
@@ -221,7 +221,10 @@ struct _MsgInfo
 
 	gint score;
 
-	gint hidden;
+	/* used only for encrypted messages */
+	gchar *plaintext_file;
+        
+        gint hidden;
 
 	/* used only for partially received messages */
 	gint total_size;

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list