The questions are:
- 1. Regarding the feature itself -- is it OK to allow smart folders modify articles' states? Or should it better be a separate facility, like "Rules" for mail sorting in Apple Mail.
2. Regarding the code -- is it really done this easy or am I missing something (re-building caches, etc.)? My testing so far shows it works as expected.
It's not actually "the code" yet, just a quick PoC, where the before-mentioned option is replaced with a hard-coded folder name:
Code: Select all
--- trunk/2.6.0/Database.m (revision 1569)
+++ trunk/2.6.0/Database.m (working copy)
@@ -2292,6 +2292,13 @@
if (folder == nil || ![article isDeleted] || IsTrashFolder(folder))
+ if (IsSmartFolder(folder) && [[folder name] isEqualTo:@"SPAM"])
+ [self markArticleRead:[article folderId] guid:[article guid] isRead:YES];
+ [article markRead:YES];
// Keep our own track of unread articles