val = GPOINTER_TO_INT(g_hash_table_lookup
(folder_table, dest_folder));
if (val == 0) {
- folder_item_scan(dest_folder);
g_hash_table_insert(folder_table, dest_folder,
GINT_TO_POINTER(1));
}
val = GPOINTER_TO_INT(g_hash_table_lookup
(folder_table, dest_folder));
if (val == 0) {
- folder_item_scan(dest_folder);
g_hash_table_insert(folder_table, dest_folder,
GINT_TO_POINTER(1));
}
return TRUE;
case MATCHACTION_MARK:
- MSG_SET_PERM_FLAGS(info->flags, MSG_MARKED);
+ procmsg_msginfo_set_flags(info, MSG_MARKED, 0);
return TRUE;
case MATCHACTION_UNMARK:
- MSG_UNSET_PERM_FLAGS(info->flags, MSG_MARKED);
+ procmsg_msginfo_unset_flags(info, MSG_MARKED, 0);
return TRUE;
case MATCHACTION_MARK_AS_READ:
- MSG_UNSET_PERM_FLAGS(info->flags, MSG_UNREAD | MSG_NEW);
+ procmsg_msginfo_unset_flags(info, MSG_UNREAD | MSG_NEW, 0);
return TRUE;
case MATCHACTION_MARK_AS_UNREAD:
debug_print("*** setting unread flags\n");
- MSG_SET_PERM_FLAGS(info->flags, MSG_UNREAD | MSG_NEW);
+ procmsg_msginfo_set_flags(info, MSG_UNREAD | MSG_NEW, 0);
return TRUE;
case MATCHACTION_COLOR:
- MSG_UNSET_PERM_FLAGS(info->flags, MSG_CLABEL_FLAG_MASK);
- MSG_SET_COLORLABEL_VALUE(info->flags, action->labelcolor);
+ procmsg_msginfo_unset_flags(info, MSG_CLABEL_FLAG_MASK, 0);
+ procmsg_msginfo_set_flags(info, MSG_COLORLABEL_TO_FLAGS(action->labelcolor), 0);
return TRUE;
case MATCHACTION_FORWARD:
gtk_widget_destroy(compose->window);
return FALSE;
- case MATCHACTION_BOUNCE:
+ case MATCHACTION_REDIRECT:
account = account_find_from_id(action->account_id);
- compose = compose_bounce(account, info);
+ compose = compose_redirect(account, info);
if (compose->account->protocol == A_NNTP)
break;
else
case MATCHACTION_MARK_AS_UNREAD:
case MATCHACTION_FORWARD:
case MATCHACTION_FORWARD_AS_ATTACHMENT:
- case MATCHACTION_BOUNCE:
+ case MATCHACTION_REDIRECT:
return FALSE; /* MsgInfo still valid for message */
default:
return FALSE;
if ((final && !applied) || !final) {
if (inbox != info->folder) {
if (folder_item_move_msg(inbox, info) == -1) {
- debug_print(_("*** Could not drop message in inbox; check .processing\n"));
+ debug_print("*** Could not drop message in inbox; check .processing\n");
return;
}
if (folder_table) {
*\param info message
*\param ftable table with changed folders after call
*/
-void filter_message_by_msginfo(GSList *flist, MsgInfo *info, GHashTable *ftable)
+void filter_message_by_msginfo_with_inbox(GSList *flist, MsgInfo *info, GHashTable *ftable, FolderItem *def_inbox)
{
FolderItem *inbox;
- if (info->folder == NULL) {
+ if ((def_inbox == NULL)) {
debug_print("using default inbox as final destination!\n");
- inbox = folder_get_default_inbox();
+ inbox = folder_get_default_inbox();
} else
- inbox = info->folder;
+ inbox = def_inbox;
/*
* message is already in a folder. the filtering code will
* handle duplicate moves and copies.
*/
- filter_msginfo(flist, inbox, info, ftable);
+ filter_msginfo(flist, inbox, info, ftable);
+}
+
+void filter_message_by_msginfo(GSList *flist, MsgInfo *info, GHashTable *ftable)
+{
+ filter_message_by_msginfo_with_inbox(flist, info, ftable, info->folder);
}
/*!
return;
}
- msginfo = procheader_parse(filename, msgflags, TRUE, FALSE);
+ msginfo = procheader_parse_file(filename, msgflags, TRUE, FALSE);
g_free(filename);
g_snprintf(dest, destlen, "%s", command_str);
return dest;
- case MATCHACTION_BOUNCE:
+ case MATCHACTION_REDIRECT:
case MATCHACTION_FORWARD:
case MATCHACTION_FORWARD_AS_ATTACHMENT:
g_snprintf(dest, destlen, "%s %d \"%s\"", command_str, action->account_id, action->destination);