diff options
Diffstat (limited to 'mail/mail-vfolder.c')
-rw-r--r-- | mail/mail-vfolder.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c index cb5be64207..706f259b85 100644 --- a/mail/mail-vfolder.c +++ b/mail/mail-vfolder.c @@ -309,6 +309,20 @@ vfolder_create_part(const char *name) return rule_context_create_part((RuleContext *)context, name); } +/* clones a filter/search rule into a matching vfolder rule (assuming the same system definitions) */ +FilterRule * +vfolder_clone_rule(FilterRule *in) +{ + FilterRule *rule = vfolder_rule_new(); + xmlNodePtr xml; + + xml = filter_rule_xml_encode(in); + filter_rule_xml_decode(rule, xml, (RuleContext *)context); + xmlFreeNodeList(xml); + + return rule; +} + /* adds a rule with a gui */ void vfolder_gui_add_rule(VfolderRule *rule) |