From mboxrd@z Thu Jan 1 00:00:00 1970 From: magnus@therning.org (Magnus Therning) Date: Sun, 9 Sep 2007 23:40:34 +0100 Subject: [sup-talk] Minor maildir change Message-ID: <20070909224034.GA3540@die.therning.org> 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