Emit 'registered' / 'unregistered' before updating the 'registered' attribute.