Alfredo Palhares | 18 Nov 2011 21:32
Gravatar

Filters doesn't work

Hello, i made a hook that adds labels, as referenced in the wiki[1] i created a before-add-message.rb into
~/.sip/hooks. it don't get anything in the logs, can anyone help me ?
As attachement i send the script.

	[1] http://sup.rubyforge.org/wiki/wiki.pl?AutoAddLabelsToNewMessages

----
Regards,
Alfredo Palhares
Attachment (before-add-message.rb): application/x-ruby, 529 bytes
_______________________________________________
sup-talk mailing list
sup-talk <at> rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
Mark Alexander | 18 Nov 2011 22:21
Picon
Favicon

Re: Filters doesn't work

Excerpts from Alfredo Palhares's message of Fri Nov 18 15:32:20 -0500 2011:

> Hello, i made a hook that adds labels, as referenced in the wiki[1]
> i created a before-add-message.rb into ~/.sip/hooks. it don't get
> anything in the logs, can anyone help me ? 

Are you sure the file is in ~/.sup/hooks, not ~/.sip/hooks?

> As attachement i send the script.

The script looks OK to me, except for this line:

  message.add_label = "texhax"

Try removing the '=' character.  It might be causing a syntax
error that prevents your script from loading.

Just as a reference, here is my ~/.sup/hooks/before-add-message.rb,
somewhat sanitized:

# Label by subject.  This is useful for messages
# generated automatically by Bugzilla or cron jobs.
case message.subj
when /\[FDBuilders/
  message.add_label :fd
when /\[P4 SUBMIT/
  message.add_label :p4
when /\[Bug/
  message.add_label :bugs
end
(Continue reading)


Gmane