Roundcube Community Forum

 

How to distinguish user-action-generated plugin hook events

Started by cozmotion, January 26, 2022, 12:51:08 PM

Previous topic - Next topic

cozmotion

I am coding a plugin to track user productivity, so I need to log certain events, like login/out, hitting the reply button, etc.  There are hooks that will track these, but not all the calls to the functions defined in the hooks are directly related to user action.  Many are generated both by the action and by the system.  For example, Clicking on reply generates a reply event, but also generates a mail-read event.  Some actions generate three or four events.  Saving a draft generates an event, but the auto-save generates the same event.

Is there a way to distinguish the directly user-generated events from the automatic ones?  I have looked at the data object that comes to the hook event, but don't see a difference.