'Auto mark read' option for smart folders

An RSS/Atom newsreader with features comparable to commercial newsreaders.
w31rd0
Harmless
Posts: 6
Joined: Tue Jun 01, 2010 6:00 pm

'Auto mark read' option for smart folders

Postby w31rd0 » Sun Jun 06, 2010 10:20 pm

I'm very interested in the feature described in this message and I'd like to implement it. But respecting the fact I'm very new to Vienna development, I think I need a review of both the feature and the code from some of the mature developers or maintainers.

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

Index: trunk/2.6.0/Database.m
===================================================================
--- trunk/2.6.0/Database.m   (revision 1569)
+++ trunk/2.6.0/Database.m   (working copy)
@@ -2292,6 +2292,13 @@
          [article setBody:text];
          if (folder == nil || ![article isDeleted] || IsTrashFolder(folder))
             [newArray addObject:article];
+
+         if (IsSmartFolder(folder) && [[folder name] isEqualTo:@"SPAM"])
+         {
+            [self markArticleRead:[article folderId] guid:[article guid] isRead:YES];
+            [article markRead:YES];
+         }
+
          [folder addArticleToCache:article];
             
          // Keep our own track of unread articles

Return to “Vienna”

Who is online

Users browsing this forum: Google [Bot]