MyBB Community Forums

Full Version: validate_post() - don't include first post of thread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have plugin which runs on "datahandler_post_validate_post" and parse every message after saving, new and edited.

But when thread-starting post is created this hook is not working, it just don't use validate_post() function. I thought that validate_post() should be used for ever post no matter what. It works when I edit first post, but not when it is created.

Why does first threads post don't pass validate_post(), where "parse_message_end" hook is located? And what hook should I use to get first post of newly created thread?
Because this first post runs off:
datahandler_post_validate_thread

See the default Akismet plugin for an example where it uses both at once.
Thanks, that helped.

But it is not logical, first post should not be treated like something totally different from other posts. The code is duplicated.
(2013-10-27, 04:32 AM)Qiao Wrote: [ -> ]Thanks, that helped.

But it is not logical, first post should not be treated like something totally different from other posts. The code is duplicated.

There is more to thread validation than post validation IIRC, it's been a long time since I looked at the code though. And yes, these 2 functions could probably be merged with no ill effect if done right.