aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder-summary.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-12-01 08:34:33 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-12-01 08:34:33 +0800
commitc1d2ec0123694a3b52e9c58de97c60994f5db587 (patch)
treeea4a4de3b8f17e616cd67bc5364e07b533f5b759 /camel/camel-folder-summary.c
parent4ace38162633ccff9497683e67e2f93f3ab850cf (diff)
downloadgsoc2013-evolution-c1d2ec0123694a3b52e9c58de97c60994f5db587.tar.gz
gsoc2013-evolution-c1d2ec0123694a3b52e9c58de97c60994f5db587.tar.zst
gsoc2013-evolution-c1d2ec0123694a3b52e9c58de97c60994f5db587.zip
New convenience function, doesn't do much but it sure makes code cleaner
2000-11-30 Jeffrey Stedfast <fejj@helixcode.com> * camel-folder-summary.c (camel_message_info_new): New convenience function, doesn't do much but it sure makes code cleaner to read. (camel_message_info_new_from_header): This one makes my life heaven. svn path=/trunk/; revision=6749
Diffstat (limited to 'camel/camel-folder-summary.c')
-rw-r--r--camel/camel-folder-summary.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 4879d547ee..b7b9b9c421 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -2138,6 +2138,60 @@ void camel_tag_list_free(CamelTag **list)
*list = NULL;
}
+
+/**
+ * camel_message_info_new:
+ *
+ * Returns a new CamelMessageInfo structure.
+ **/
+CamelMessageInfo *
+camel_message_info_new ()
+{
+ CamelMessageInfo *info;
+
+ info = g_new0 (CamelMessageInfo, 1);
+#ifdef DOESTRV
+ info->strings = e_strv_new (CAMEL_MESSAGE_INFO_LAST);
+#endif
+
+ return info;
+}
+
+
+/**
+ * camel_message_info_new_from_header:
+ * @header: raw header
+ *
+ * Returns a new CamelMessageInfo structure populated by the header.
+ **/
+CamelMessageInfo *
+camel_message_info_new_from_header (struct _header_raw *header)
+{
+ CamelMessageInfo *info;
+ char *subject, *from, *to, *cc;
+
+ subject = camel_folder_summary_format_string (header, "subject");
+ from = camel_folder_summary_format_address (header, "from");
+ to = camel_folder_summary_format_address (header, "to");
+ cc = camel_folder_summary_format_address (header, "cc");
+
+ info = g_new0 (CamelMessageInfo, 1);
+#ifdef DOESTRV
+ info->strings = e_strv_new (CAMEL_MESSAGE_INFO_LAST);
+ camel_message_info_set_subject (info, subject);
+ camel_message_info_set_from (info, from);
+ camel_message_info_set_to (info, to);
+ camel_message_info_set_cc (info, cc);
+#else
+ info->subject = subject;
+ info->from = from;
+ info->to = to;
+ info->cc = cc;
+#endif
+
+ return info;
+}
+
/**
* camel_message_info_dup_to:
* @from: source message info