Next: , Previous: Standard alerts, Up: Customizing alerts

15.5.2 Presence alerts

Set jabber-alert-presence-message-function to your desired function. This function should look like:

     (defun function (who oldstatus newstatus statustext)

who is the JID symbol (see JID symbols), oldstatus and newstatus are the previous and current stati, respectively, and statustext is the status message if provided, otherwise nil.

oldstatus and newstatus can be one of "" (i.e. online), "away", "xa", "dnd", "chat", "error" and nil (i.e. offline).

newstatus can also be one of "subscribe", "subscribed", "unsubscribe" and "unsubscribed".

The default function, jabber-presence-default-message, returns nil if oldstatus and newstatus are the same, and in other cases constructs a message from the given data.

Another function, jabber-presence-only-chat-open-message, behave just like jabber-presence-default-message, but only if conversation buffer for according JID is already open. Use it to show presence notifications only for “interesting” contacts.

All presence alert hooks take the same arguments plus the additional proposed-alert, which is the result of the specified message function. This last argument is usually the only one they use.