/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2009 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2011 Hiroyuki Yamamoto and the Claws Mail 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
{
GNode *node, *start_node;
FolderUpdateData hookdata;
- gchar *tags_file = NULL;
+ gchar *tags_file = NULL, *tags_dir = NULL;
cm_return_if_fail(item != NULL);
cm_return_if_fail(item->folder != NULL);
tags_file = folder_item_get_tags_file(item);
if (tags_file)
claws_unlink(tags_file);
+ tags_dir = g_path_get_dirname(tags_file);
+ if (tags_dir)
+ rmdir(tags_dir);
+
g_free(tags_file);
+ g_free(tags_dir);
hookdata.folder = item->folder;
hookdata.update_flags = FOLDER_TREE_CHANGED | FOLDER_REMOVE_FOLDERITEM;
item->hide_read_msgs = *attr->value == '1' ? TRUE : FALSE;
else if (!strcmp(attr->name, "hidedelmsgs"))
item->hide_del_msgs = *attr->value == '1' ? TRUE : FALSE;
+ else if (!strcmp(attr->name, "hidereadthreads"))
+ item->hide_read_threads = *attr->value == '1' ? TRUE : FALSE;
else if (!strcmp(attr->name, "reqretrcpt"))
item->ret_rcpt = *attr->value == '1' ? TRUE : FALSE;
else if (!strcmp(attr->name, "sort_key")) {
xml_tag_add_attr(tag, xml_attr_new("threaded", item->threaded ? "1" : "0"));
xml_tag_add_attr(tag, xml_attr_new("hidereadmsgs", item->hide_read_msgs ? "1" : "0"));
xml_tag_add_attr(tag, xml_attr_new("hidedelmsgs", item->hide_del_msgs ? "1" : "0"));
+ xml_tag_add_attr(tag, xml_attr_new("hidereadthreads", item->hide_read_threads ? "1" : "0"));
if (item->ret_rcpt)
xml_tag_add_attr(tag, xml_attr_new("reqretrcpt", "1"));
return id;
}
+Folder *folder_find_from_identifier(const gchar *identifier)
+{
+ gchar *str;
+ gchar *p;
+ gchar *name;
+ FolderClass *class;
+
+ cm_return_val_if_fail(identifier != NULL, NULL);
+
+ if (*identifier != '#')
+ return NULL;
+
+ Xstrdup_a(str, identifier, return NULL);
+
+ p = strchr(str, '/');
+ if (!p)
+ return NULL;
+ *p = '\0';
+ p++;
+ class = folder_get_class_from_string(&str[1]);
+ if (class == NULL)
+ return NULL;
+
+ name = p;
+ p = strchr(p, '/');
+ if (p)
+ return NULL;
+
+ return folder_find_from_name(name, class);
+}
+
FolderItem *folder_find_item_from_identifier(const gchar *identifier)
{
Folder *folder;
strcmp(mimeinfo->subtype, "pkcs7-signature")))) {
procmsg_msginfo_set_flags(msginfo, 0, MSG_HAS_ATTACHMENT);
} else if (mimeinfo->disposition == DISPOSITIONTYPE_UNKNOWN &&
+ mimeinfo->id == NULL &&
mimeinfo->type != MIMETYPE_TEXT &&
mimeinfo->type != MIMETYPE_MULTIPART) {
if (!mimeinfo->subtype
strcmp(mimeinfo->subtype, "pkcs7-signature")))
procmsg_msginfo_set_flags(msginfo, 0, MSG_HAS_ATTACHMENT);
} else if (mimeinfo->disposition == DISPOSITIONTYPE_INLINE &&
+ mimeinfo->id == NULL &&
(strcmp(mimeinfo->subtype, "pgp-signature") &&
strcmp(mimeinfo->subtype, "x-pkcs7-signature") &&
strcmp(mimeinfo->subtype, "pkcs7-signature")) &&
static void add_msginfo_to_cache(FolderItem *item, MsgInfo *newmsginfo, MsgInfo *flagsource)
{
+ MsgInfoUpdate msginfo_update;
+
/* update folder stats */
if (MSG_IS_NEW(newmsginfo->flags))
item->new_msgs++;
if (!item->cache)
folder_item_read_cache(item);
+ msginfo_update.msginfo = newmsginfo;
+ msginfo_update.flags = MSGINFO_UPDATE_ADDED;
+ hooks_invoke(MSGINFO_UPDATE_HOOKLIST, &msginfo_update);
+
msgcache_add_msg(item->cache, newmsginfo);
copy_msginfo_flags(flagsource, newmsginfo);
folder_item_update_with_msg(item, F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT | F_ITEM_UPDATE_ADDMSG, newmsginfo);
new_item->ret_rcpt = src->ret_rcpt;
new_item->hide_read_msgs = src->hide_read_msgs;
new_item->hide_del_msgs = src->hide_del_msgs;
+ new_item->hide_read_threads = src->hide_read_threads;
new_item->sort_key = src->sort_key;
new_item->sort_type = src->sort_type;
item->ret_rcpt = pp->ret_rcpt;
item->hide_read_msgs = pp->hide_read_msgs;
item->hide_del_msgs = pp->hide_del_msgs;
+ item->hide_read_threads = pp->hide_read_threads;
item->sort_key = pp->sort_key;
item->sort_type = pp->sort_type;
}
pp->ret_rcpt = item->ret_rcpt;
pp->hide_read_msgs = item->hide_read_msgs;
pp->hide_del_msgs = item->hide_del_msgs;
+ pp->hide_read_threads = item->hide_read_threads;
pp->sort_key = item->sort_key;
pp->sort_type = item->sort_type;
g_hash_table_insert(pptable, id, pp);