Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: magnus@therning.org (Magnus Therning)
Subject: [sup-talk] Minor maildir change
Date: Sun, 9 Sep 2007 23:40:34 +0100	[thread overview]
Message-ID: <20070909224034.GA3540@die.therning.org> (raw)

I thought it was a little strange the file_path on Maildir objects
returned `nil` so I changed that to return the path of the maildir.

I am somewhat puzzled by the labels one receives from Maildir::each,
it's the default labels for the source rather than the labels of the
actual message.  Especially confusing was the choice to label something
'unread' if it's filename doesn't contains an 'R'.  IIRC 'R' means that
the email has been replied to, it would have been more correct to mark
it unread if it doesn't contain an 'S' (as in seen).  However, it seems
silly to take any of this into consideration when sup doesn't deal with
maildirs "properly" anyway.  I've removed that strangeness, at least
until a full maildir implementation makes it into sup.

/M

=== modified file 'lib/sup/maildir.rb'
--- lib/sup/maildir.rb	2007-09-09 22:27:27 +0000
+++ lib/sup/maildir.rb	2007-09-09 22:29:52 +0000
@@ -27,6 +27,7 @@
     @mutex = Mutex.new
   end
 
+  def file_path; @dir end
   def self.suggest_labels_for path; [] end
 
   def check
@@ -93,7 +94,7 @@
     start.upto(@ids.length - 1) do |i|         
       id = @ids[i]
       self.cur_offset = id
-      yield id, @labels + (@ids_to_fns[id] =~ /,.*R.*$/ ? [] : [:unread])
+      yield id, @labels
     end
   end
 


-- 
Magnus Therning                             (OpenPGP: 0xAB4DFBA4)
magnus?therning?org             Jabber: magnus?therning?gmail?com
http://therning.org/magnus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://rubyforge.org/pipermail/sup-talk/attachments/20070909/3ea679f1/attachment-0001.bin 


             reply	other threads:[~2007-09-09 22:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-09 22:40 Magnus Therning [this message]
2007-09-14  3:33 ` William Morgan
2007-09-16 18:19   ` Magnus Therning
2007-09-19 15:59     ` William Morgan
2007-09-19 22:02       ` Magnus Therning
2007-09-24  2:29         ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070909224034.GA3540@die.therning.org \
    --to=magnus@therning.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox