Hi all,
I'm currently writing a plugin that needs to act after an identity has been inserted into database. There is an identity_create hook that is called before the identity is inserted. How about adding a hook (whose argument would be data for the newly created identity, including the identity_id), that would be called after the database record has been created?
That way you could write a plugin that could, e.g.
identity data 2. use the new identity_stored (or something similar) hook to write it's own record into its own database table (with a constraint referencing the new identity) and commit the transaction (or rollback if something went wrong)
Similar to those, I would also propose post-insert/update hooks for other events that could prove useful, so:
identity_stored ( $record ) for after an identity was stored (created or updated) user_created ( $record ) for after a new user has been created contact_stored ( $record ) for after a contact has been stored (created or updated) group_stored ( $record ) for after a group has been stored (created, updated, renamed, members added, members deleted) preferences_stored ( $record ) for after user's preferences have been saved
Is this acceptable? It's not too complicated to add those and I'd be willing to contribute the code and document the changes on the wiki. If not, I'd appreciate if you could clue me into how I might be able to write a plugin that needs to do something similar as described above (i.e. create records in additional tables that keep referential integrity with records in Roundcube's own tables).
Regards, Tin