Hi - Last one for now. This fixes the hook for filtering messages so that messages you tag with spam/killed/deleted in the hook dont get displayed by the inbox. Just to confirm something: if you want to tag using one of these labels you need to use the ruby symbol in the hook :spam, :killed and :deleted Eg: message.add_label :spam if message.raw_header =~ /X-Spam-Flag: YES/ Marcus -------------- next part -------------- A non-text attachment was scrubbed... Name: before-add-message-hook Type: application/octet-stream Size: 1117 bytes Desc: not available Url : http://rubyforge.org/pipermail/sup-talk/attachments/20071106/07ad0c18/attachment.obj
Excerpts from Marcus Williams''s message of Tue Nov 06 02:25:04 -0800 2007:> Last one for now. This fixes the hook for filtering messages so that > messages you tag with spam/killed/deleted in the hook dont get > displayed by the inbox.And applied. Thanks for all your hard work, Marcus! -- William <wmorgan-sup at masanjin.net>
On 7.11.2007, William Morgan wrote:> Excerpts from Marcus Williams''s message of Tue Nov 06 02:25:04 -0800 2007: > > Last one for now. This fixes the hook for filtering messages so that > > messages you tag with spam/killed/deleted in the hook dont get > > displayed by the inbox. > > And applied. Thanks for all your hard work, Marcus!... Mmmm - I''m having a few problems with that is-relevant change. Sometimes (I''ve just seen one now) I get a new message that doesnt make it to the inbox. Whats odd is that it does appear if I pull in a few more threads or somehow update the inbox buffer. It might not be related to this change, but I''d not noticed it until just now. I''ll see if I can reproduce it somehow. Marcus
On 7.11.2007, Marcus Williams wrote:> It might not be related to this change, but I''d not noticed it until > just now. I''ll see if I can reproduce it somehow.Got it - in is_relevant you changed the patch to use "&&" instead of "and" and I think this broke it because of the precedence of "&&" makes it do m.labels.include? (:inbox && ......) whereas mine does (m.labels.include? :inbox) and (......) reverting back to "and" fixes it in my version. Marcus
Excerpts from Marcus Williams''s message of Wed Nov 07 08:34:32 -0800 2007:> Got it - in is_relevant you changed the patch to use "&&" instead of > "and" and I think this broke it because of the precedence of "&&" > makes it doGood catch. Fixed in SVN. (Still refusing to use "and" though :) ) -- William <wmorgan-sup at masanjin.net>
Excerpts from William Morgan''s message of Wed Nov 07 09:35:11 -0800 2007:> Good catch. Fixed in SVN. (Still refusing to use "and" though > :) )To be clear, idiomatic Ruby is to use and/or for short-cut exit checks like "or return nil", and use && and || for all "normal" boolean comparisons. I''m not just trying to be a jerk! But I did blindly make that change your patch without thinking about what I was doing, so thank you for catching that. -- William <wmorgan-sup at masanjin.net>
Christopher Warrington
2007-Nov-07 18:38 UTC
[sup-talk] [PATCH] Fix for before-add-message hook
Excerpts from William Morgan''s message of Wed Nov 07 11:35:11 -0600 2007:> Good catch. Fixed in SVN. (Still refusing to use "and" though > :) )Thanks guys! This had been bugging me all day. -- Christopher Warrington <chrisw at rice.edu> Jones College