Invoke a hook when a user starts or stops masquerading. This will allow other modules to perform necessary actions.
See attached patch file
#1364574: Invoke logout & login hooks for compatibility with bakery
This issue about introducing hooks and probably reactions for example with rules
My bad. They are different hooks.
@deekayen suppose for d8 we just need to define action (trigger is not more in core) and has a masquarade.rules.inc file when d8 branch of rules become ready
So let's fix this in D7 first
Not sure which direction to head, but #1458418: Add masquerade events API aims to do the same thing (and a little more).
Drupal is a registered trademark of Dries Buytaert.