From mboxrd@z Thu Jan 1 00:00:00 1970 From: stubbsd@zetani.com (David Stubbs) Date: Fri, 19 Oct 2007 13:51:27 +0100 Subject: [sup-talk] [PATCH] New hook (enabling message filters) In-Reply-To: <47188C6F.30008@quintic.co.uk> References: <47188C6F.30008@quintic.co.uk> Message-ID: <1192797904-sup-1316@DASMac.local> Excerpts from Marcus Williams's message of Fri Oct 19 11:52:31 +0100 2007: > Hi - > > Attached is a patch to poll.rb to add the ability to filter messages > pre-indexing. Theres one current problem with it which I cant figure out > and thats the warnings you get when its run from sup-sync about missing > a say_id - I think this is something to do with not having a buffer > manager in sup-sync. Anyone any ideas how to get the say method in > hooks.rb to fail gracefully to something else if the buffermanager isnt > available? > > This hook allows you to do this in your .sup/hooks/before-add-message.rb: > > ## > if message.subj =~ /^\[sup-talk\]/ > message.add_label "sup" > message.add_label "list" > end > > message.add_label "work" if message.from =~ /mywork at email.com/ > message.add_label "home" if message.from =~ /myhome at email.com/ > ## > > .... and then when polling or during sup-sync this hook gets run for > every message it adds to the index. "message" is the about-to-be-indexed > email, changes made to it get passed on into the index. > > Any comments or fixes (like the "say" issue), mail me (or reply on list) > > Marcus Hi Marcus, Attached is a patch to stop warning for @__say_id when using hooks. -------------- next part -------------- A non-text attachment was scrubbed... Name: hook.diff Type: application/octet-stream Size: 354 bytes Desc: not available Url : http://rubyforge.org/pipermail/sup-talk/attachments/20071019/1832ed0e/attachment.obj