The documentation for CallbackHandler-1.0 states that the way for mixing it in a library is like that:
lua Code:
local lib = LibStub:NewLibrary("MyLibName", 1)
lib.callbacks = lib.callbacks or LibStub("CallbackHandler-1.0"):New(lib)
The reasoning behind this is that the user could have multiple versions of the lib installed and the lib does not have control over the loading order. So lib.callbacks = lib.callbacks will retain attached callbacks from previously loaded versions.
If this is so, that means I have to always attach the callbacks table to the lib object, which in turn means everybody on the outside can fire my events instead of me. And if I give some event arguments back, then they could use that too to provide false data in my name.
lua Code:
local libToHack = LibStub("MyLibName")
libToHack.callbacks:Fire("MyEventName", "Got you")
And the user can't tell if I passed "Got you" or someone else.
Am I able to prevent this somehow?