Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] [PATCH] Fix for before-add-message hook
@ 2007-11-06 10:25 Marcus Williams
  2007-11-07  1:56 ` William Morgan
  0 siblings, 1 reply; 7+ messages in thread
From: Marcus Williams @ 2007-11-06 10:25 UTC (permalink / raw)


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 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [sup-talk] [PATCH] Fix for before-add-message hook
  2007-11-06 10:25 [sup-talk] [PATCH] Fix for before-add-message hook Marcus Williams
@ 2007-11-07  1:56 ` William Morgan
  2007-11-07 16:06   ` Marcus Williams
  0 siblings, 1 reply; 7+ messages in thread
From: William Morgan @ 2007-11-07  1:56 UTC (permalink / raw)


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>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [sup-talk] [PATCH] Fix for before-add-message hook
  2007-11-07  1:56 ` William Morgan
@ 2007-11-07 16:06   ` Marcus Williams
  2007-11-07 16:34     ` Marcus Williams
  0 siblings, 1 reply; 7+ messages in thread
From: Marcus Williams @ 2007-11-07 16:06 UTC (permalink / raw)


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [sup-talk] [PATCH] Fix for before-add-message hook
  2007-11-07 16:06   ` Marcus Williams
@ 2007-11-07 16:34     ` Marcus Williams
  2007-11-07 17:35       ` William Morgan
  0 siblings, 1 reply; 7+ messages in thread
From: Marcus Williams @ 2007-11-07 16:34 UTC (permalink / raw)


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [sup-talk] [PATCH] Fix for before-add-message hook
  2007-11-07 16:34     ` Marcus Williams
@ 2007-11-07 17:35       ` William Morgan
  2007-11-07 17:41         ` William Morgan
  2007-11-07 18:38         ` Christopher Warrington
  0 siblings, 2 replies; 7+ messages in thread
From: William Morgan @ 2007-11-07 17:35 UTC (permalink / raw)


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 do

Good catch. Fixed in SVN. (Still refusing to use "and" though
:) )

-- 
William <wmorgan-sup at masanjin.net>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [sup-talk] [PATCH] Fix for before-add-message hook
  2007-11-07 17:35       ` William Morgan
@ 2007-11-07 17:41         ` William Morgan
  2007-11-07 18:38         ` Christopher Warrington
  1 sibling, 0 replies; 7+ messages in thread
From: William Morgan @ 2007-11-07 17:41 UTC (permalink / raw)


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>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [sup-talk] [PATCH] Fix for before-add-message hook
  2007-11-07 17:35       ` William Morgan
  2007-11-07 17:41         ` William Morgan
@ 2007-11-07 18:38         ` Christopher Warrington
  1 sibling, 0 replies; 7+ messages in thread
From: Christopher Warrington @ 2007-11-07 18:38 UTC (permalink / raw)


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-11-07 18:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-06 10:25 [sup-talk] [PATCH] Fix for before-add-message hook Marcus Williams
2007-11-07  1:56 ` William Morgan
2007-11-07 16:06   ` Marcus Williams
2007-11-07 16:34     ` Marcus Williams
2007-11-07 17:35       ` William Morgan
2007-11-07 17:41         ` William Morgan
2007-11-07 18:38         ` Christopher Warrington

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox