g_return_val_if_fail(folder != NULL, -1);
g_return_val_if_fail(folder->klass->get_num_list != NULL, -1);
- debug_print("Scanning folder %s for cache changes.\n", item->path);
+ debug_print("Scanning folder %s for cache changes.\n", item->path ? item->path : "(null)");
/* Get list of messages for folder and cache */
if (folder->klass->get_num_list(item->folder, item, &folder_list, &old_uids_valid) < 0) {
MsgInfo *msginfo = data;
MimeInfo *mimeinfo = node->data;
- if (mimeinfo->disposition == DISPOSITIONTYPE_ATTACHMENT) {
+ if (mimeinfo->disposition == DISPOSITIONTYPE_ATTACHMENT
+ && (!mimeinfo->subtype || strcmp(mimeinfo->subtype, "pgp-signature"))) {
procmsg_msginfo_set_flags(msginfo, 0, MSG_HAS_ATTACHMENT);
} else if (mimeinfo->disposition == DISPOSITIONTYPE_UNKNOWN &&
mimeinfo->type != MIMETYPE_TEXT &&
g_return_val_if_fail(item != NULL, -1);
g_return_val_if_fail(item->no_select == FALSE, -1);
- debug_print("fetching all messages in %s ...\n", item->path);
- statusbar_print_all(_("Fetching all messages in %s ...\n"), item->path);
+ debug_print("fetching all messages in %s ...\n", item->path ? item->path : "(null)");
+ statusbar_print_all(_("Fetching all messages in %s ...\n"), item->path ? item->path : "(null)");
folder = item->folder;
return -1;
}
} else {
- for (l = msglist ; l != NULL ; l = g_slist_next(l)) {
- MsgInfo * msginfo = (MsgInfo *) l->data;
+ MsgInfo * msginfo;
+ l = msglist;
+
+ /* immediately stop if src and dest folders are identical */
+ if (l != NULL) {
+ msginfo = (MsgInfo *) l->data;
+ if (msginfo != NULL && msginfo->folder == dest) {
+ g_relation_destroy(relation);
+ return -1;
+ }
+ }
+
+ for (; l != NULL ; l = g_slist_next(l)) {
+ msginfo = (MsgInfo *) l->data;
num = folder->klass->copy_msg(folder, dest, msginfo);
if (num > 0)
if (item->update_flags) {
source.item = item;
source.update_flags = item->update_flags;
+ source.msg = NULL;
hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
item->update_flags = 0;
}
&& item != cur) {
debug_print("set item %s parent type to %d "
"even if %s is F_INBOX\n",
- item->path, 0, cur->path);
+ item->path ? item->path : "(null)",
+ 0, cur->path);
item->parent_stype = F_NORMAL;
break;
}
item->parent_stype = cur->parent_stype;
debug_print("set item %s parent type to %d "
"from %s's parent type\n",
- item->path, cur->parent_stype,
- cur->path);
+ item->path ? item->path : "(null)",
+ cur->parent_stype ? cur->parent_stype : 0,
+ cur->path ? cur->path : "(null)");
break;
}
/* we found a parent that has a special type. That's
if (cur->stype != F_NORMAL) {
debug_print("set item %s parent type to %d "
"from %s's type\n",
- item->path, cur->stype, cur->path);
+ item->path ? item->path : "(null)",
+ cur->stype ? cur->stype : 0,
+ cur->path ? cur->path : "(null)");
cur->parent_stype = cur->stype;
item->parent_stype = cur->stype;
break;
* normal. */
if (item->parent_stype == -1) {
debug_print("set item %s to 0 from default\n",
- item->path);
+ item->path ? item->path : "(null)");
item->parent_stype = F_NORMAL;
}
}