aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-08-23 03:55:56 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-08-23 03:55:56 +0000
commit50eeb3d818c7c36f03d0c195c48528c2cd2731ee (patch)
treede0247b4b7024749c8945ec3c998e55f677a8f86 /libsylph
parent830583f24a6753bea7aae2704c41303ff6b0ad03 (diff)
added signature information to MsgInfo.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1128 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/procmime.c1
-rw-r--r--libsylph/procmime.h1
-rw-r--r--libsylph/procmsg.c33
-rw-r--r--libsylph/procmsg.h14
4 files changed, 37 insertions, 12 deletions
diff --git a/libsylph/procmime.c b/libsylph/procmime.c
index 28bb9d1f..193c23e0 100644
--- a/libsylph/procmime.c
+++ b/libsylph/procmime.c
@@ -68,7 +68,6 @@ void procmime_mimeinfo_free_all(MimeInfo *mimeinfo)
g_free(mimeinfo->content_disposition);
g_free(mimeinfo->filename);
- g_free(mimeinfo->plaintextfile);
g_free(mimeinfo->sigstatus);
g_free(mimeinfo->sigstatus_full);
diff --git a/libsylph/procmime.h b/libsylph/procmime.h
index ac86a63c..a4bbd312 100644
--- a/libsylph/procmime.h
+++ b/libsylph/procmime.h
@@ -118,7 +118,6 @@ struct _MimeInfo
MimeInfo *children;
MimeInfo *plaintext;
- gchar *plaintextfile;
gchar *sigstatus;
gchar *sigstatus_full;
diff --git a/libsylph/procmsg.c b/libsylph/procmsg.c
index e212a7cd..13141f50 100644
--- a/libsylph/procmsg.c
+++ b/libsylph/procmsg.c
@@ -1078,8 +1078,8 @@ gchar *procmsg_get_message_file_path(MsgInfo *msginfo)
g_return_val_if_fail(msginfo != NULL, NULL);
- if (msginfo->plaintext_file)
- file = g_strdup(msginfo->plaintext_file);
+ if (msginfo->encinfo && msginfo->encinfo->plaintext_file)
+ file = g_strdup(msginfo->encinfo->plaintext_file);
else if (msginfo->file_path)
return g_strdup(msginfo->file_path);
else {
@@ -1473,8 +1473,13 @@ MsgInfo *procmsg_msginfo_copy(MsgInfo *msginfo)
MEMBDUP(file_path);
- MEMBDUP(plaintext_file);
- MEMBCOPY(decryption_failed);
+ if (msginfo->encinfo) {
+ newmsginfo->encinfo = g_new0(MsgEncryptInfo, 1);
+ MEMBDUP(encinfo->plaintext_file);
+ MEMBDUP(encinfo->sigstatus);
+ MEMBDUP(encinfo->sigstatus_full);
+ MEMBCOPY(encinfo->decryption_failed);
+ }
return newmsginfo;
}
@@ -1504,8 +1509,17 @@ MsgInfo *procmsg_msginfo_get_full_info(MsgInfo *msginfo)
full_msginfo->file_path = g_strdup(msginfo->file_path);
- full_msginfo->plaintext_file = g_strdup(msginfo->plaintext_file);
- full_msginfo->decryption_failed = msginfo->decryption_failed;
+ if (msginfo->encinfo) {
+ full_msginfo->encinfo = g_new0(MsgEncryptInfo, 1);
+ full_msginfo->encinfo->plaintext_file =
+ g_strdup(msginfo->encinfo->plaintext_file);
+ full_msginfo->encinfo->sigstatus =
+ g_strdup(msginfo->encinfo->sigstatus);
+ full_msginfo->encinfo->sigstatus_full =
+ g_strdup(msginfo->encinfo->sigstatus_full);
+ full_msginfo->encinfo->decryption_failed =
+ msginfo->encinfo->decryption_failed;
+ }
return full_msginfo;
}
@@ -1549,7 +1563,12 @@ void procmsg_msginfo_free(MsgInfo *msginfo)
g_free(msginfo->file_path);
- g_free(msginfo->plaintext_file);
+ if (msginfo->encinfo) {
+ g_free(msginfo->encinfo->plaintext_file);
+ g_free(msginfo->encinfo->sigstatus);
+ g_free(msginfo->encinfo->sigstatus_full);
+ g_free(msginfo->encinfo);
+ }
g_free(msginfo);
}
diff --git a/libsylph/procmsg.h b/libsylph/procmsg.h
index 3fc7e119..32172142 100644
--- a/libsylph/procmsg.h
+++ b/libsylph/procmsg.h
@@ -33,6 +33,7 @@
typedef struct _MsgInfo MsgInfo;
typedef struct _MsgFlags MsgFlags;
typedef struct _MsgFileInfo MsgFileInfo;
+typedef struct _MsgEncryptInfo MsgEncryptInfo;
#include "folder.h"
#include "procmime.h"
@@ -195,9 +196,8 @@ struct _MsgInfo
/* used only for temporary messages */
gchar *file_path;
- /* used only for encrypted messages */
- gchar *plaintext_file;
- guint decryption_failed : 1;
+ /* used only for encrypted (and signed) messages */
+ MsgEncryptInfo *encinfo;
};
struct _MsgFileInfo
@@ -206,6 +206,14 @@ struct _MsgFileInfo
MsgFlags *flags;
};
+struct _MsgEncryptInfo
+{
+ gchar *plaintext_file;
+ gchar *sigstatus;
+ gchar *sigstatus_full;
+ gboolean decryption_failed;
+};
+
typedef FILE * (*DecryptMessageFunc) (MsgInfo *msginfo,
MimeInfo **mimeinfo);