Is there a way to only listen for certain events through hooks?
-
I am sorry, but I did see a post, I believe, in this forum, but I can't seem to find it anymore. Anyway, to reduce the load on the server (does it even affect the load, since it is within the server/codebase?), I want to only listen to, let's say, action:topic.reply by a specific user and/or in a specific post/category. How can we achieve this? Should I care? Or should I just do something like:
if (data.tid == "1" && data.uid == "1") {...}
-
Most likely all server-side hooks are not specific to users (unless the UID is in the hook name, but I doubt we have any), so you'll have to just do an early-return if the condition doesn't match. It is likely not going to cause issues with the server. There are a thousand things that would need to be optimized before something like this causes a slowdown
-
-