2006-02-05 [colin] 2.0.0cvs13
[claws.git] / src / procmsg.c
index 342a510dc526e5f499e76ea300e117afd53dd0a1..0e0b4895cc86f96822c88db5e35a9d99503dea99 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2005 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Sylpheed-Claws team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
 #include "defs.h"
@@ -1152,6 +1152,7 @@ MsgInfo *procmsg_msginfo_copy(MsgInfo *msginfo)
        MEMBCOPY(folder);
        MEMBCOPY(to_folder);
 
+       MEMBDUP(face);
        MEMBDUP(xface);
        MEMBDUP(dispositionnotificationto);
        MEMBDUP(returnreceiptto);
@@ -1194,6 +1195,8 @@ MsgInfo *procmsg_msginfo_get_full_info(MsgInfo *msginfo)
         * procheader.c::procheader_get_headernames() */
        if (!msginfo->xface)
                msginfo->xface = g_strdup(full_msginfo->xface);
+       if (!msginfo->face)
+               msginfo->face = g_strdup(full_msginfo->face);
        if (!msginfo->dispositionnotificationto)
                msginfo->dispositionnotificationto = 
                        g_strdup(full_msginfo->dispositionnotificationto);
@@ -1233,6 +1236,7 @@ void procmsg_msginfo_free(MsgInfo *msginfo)
        g_free(msginfo->returnreceiptto);
        g_free(msginfo->dispositionnotificationto);
        g_free(msginfo->xface);
+       g_free(msginfo->face);
 
        g_free(msginfo->fromname);
 
@@ -1284,6 +1288,8 @@ guint procmsg_msginfo_memusage(MsgInfo *msginfo)
                memusage += strlen(msginfo->inreplyto);
        if (msginfo->xface)
                memusage += strlen(msginfo->xface);
+       if (msginfo->face)
+               memusage += strlen(msginfo->face);
        if (msginfo->dispositionnotificationto)
                memusage += strlen(msginfo->dispositionnotificationto);
        if (msginfo->returnreceiptto)
@@ -1960,16 +1966,19 @@ gboolean procmsg_msginfo_filter(MsgInfo *msginfo)
        MailFilteringData mail_filtering_data;
                        
        mail_filtering_data.msginfo = msginfo;                  
-       if (hooks_invoke(MAIL_FILTERING_HOOKLIST, &mail_filtering_data))
+       if (hooks_invoke(MAIL_FILTERING_HOOKLIST, &mail_filtering_data)) {
+               hooks_invoke(MAIL_POSTFILTERING_HOOKLIST, msginfo);
                return TRUE;
+       }
 
        /* filter if enabled in prefs or move to inbox if not */
        if((filtering_rules != NULL) &&
-          filter_message_by_msginfo(filtering_rules, msginfo))
+          filter_message_by_msginfo(filtering_rules, msginfo)) {
+               hooks_invoke(MAIL_POSTFILTERING_HOOKLIST, msginfo);
                return TRUE;
+       }
                
        hooks_invoke(MAIL_POSTFILTERING_HOOKLIST, msginfo);
-
        return FALSE;
 }
 
@@ -2000,7 +2009,8 @@ MsgInfo *procmsg_msginfo_new_from_mimeinfo(MsgInfo *src_msginfo, MimeInfo *mimei
                fclose(fp);
 
        if (tmp_msginfo != NULL) {
-               tmp_msginfo->folder = src_msginfo->folder;
+               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");