Skip to content
Snippets Groups Projects
user avatar
Andrey Saranchin authored
The commit populates submodule session with an event for each public
trigger - they will be used for user-defined triggers. Old triggers are
not removed because they are used for internal purposes - audit from EE
uses them, for instance. Also, the commit introduces a test for all
triggers that use old API. It checks only session triggers now - all the
other triggers will be included there after they will be moved to the
trigger registry.

In order to have an opportunity to move user-defined triggers to trigger
registry, the commit introduces helper luaT_event_reset_trigger that
supports two different ways to set triggers - key-value API and positional
API. The first one is a new API that allows to set or delete trigger only
by name. The second API is implemented for the sake of backward
compatibility - it mimics behavior of function lbox_trigger_reset, which
was used to modify triggers, but sets the triggers to event from trigger
registry instead of separate trigger list. Also, positional API allows
to pass a name as the third argument - in this case the function will
set or delete trigger by passed name - the first argument is a new
trigger (or nil, if the function is called to delete a trigger), the
second argument will be ignored in this case.

The new helper supports not only functions - any callable object can be
used as a trigger.

Part of #6484
Part of #8657

NO_CHANGELOG=later
NO_DOC=later
abefe2c6
History
Name Last commit Last update