10 - [FIX ATTACHED] Post-hooks so other add-ons can ignore spam
I'm working on the LFMonitor add-on, and have added a fairly CPU-intensive Bayesian-esque multidimensional classifier to it. Since this classifier is fairly CPU-intensive (it uses fuzzy word matching), I don't want it to waste CPU cycles on spam for users that have SpamBayes. I tried having LFMonitor install itself as an AddMessageEventFilter, and declare SpamBayes as an optional dependency so it would load first (and therefore hopefully show up on the table first), but this didn't work.
The attached version of SpamBayes.lua exposes the function SpamBayes:addPostHook(f). When called with a function parameter, filter() will start calling that function with its own set of arguments, but only after classifying a message as ham or unsure.
| Name | Description | Size | MD5 |
|---|---|---|---|
| SpamBayes.lua | An improved version. Now allows ... | 14.7 KiB | 61f867fd1e81... |
| User | When | Change |
|---|---|---|
| merah | Sep 06, 2011 at 11:44 UTC | Changed status from New to Accepted |
| seahen | Sep 03, 2011 at 19:23 UTC | Added attachment SpamBayes.lua |
| seahen | Sep 03, 2011 at 19:22 UTC | Deleted attachment SpamBayes.lua: Uploading a slightly improved version |
| seahen | Sep 03, 2011 at 19:11 UTC | Added attachment SpamBayes.lua |
| seahen | Sep 03, 2011 at 19:10 UTC | Create |
- 3 comments
- 3 comments
- Reply
- #3
seahen Sep 22, 2011 at 19:04 UTC - 0 likesUpdate: I no longer need this feature for LFMonitor. I've figured out how to post-hook ChatFrame_AddMessageEventFilter to ensure my function is always last on the filter list (unless another add-on does the same).
- Reply
- #2
merah Sep 06, 2011 at 11:45 UTC - 0 likesThank you seahen, i will do this ASAP
- Reply
- #1
seahen Sep 03, 2011 at 19:16 UTC - 0 likesNB: LFMonitor is *not* a spam filter. Its purpose is to bring especially relevant trade messages to the user's attention, on high-population servers such as Blackrock Horde (which peaks at over 20 non-spam messages per minute). I may later add the ability to filter out LFG/LFM/etc. messages that aren't of interest, but this will be based on user preferences (which are likely to change from day to day based on raid lockouts etc.) and won't trigger automatic reporting.