jabber.el provides various hooks that you can use for whatever purpose.
jabber-send-current-presence(see Presence). The hook functions get the connection object as argument.
The hook is called with one argument: the connection object.
jabber-disconnect, the command to disconnect all accounts. There is currently no hook for disconnection of a single account.