If you don't want message alerts when the chat buffer in question is
already the current buffer, set jabber-message-alert-same-buffer
to nil. This affects the behaviour of the default message function, so
you'll have to reimplement this functionality if you write your own
message function.
Set jabber-alert-message-function
to your desired
function.1 This function should look like:
(defun function (from buffer text) ... )
from is the JID symbol (see Roster structure), buffer is the buffer where the message is displayed, and text is the text of the message.
The default function, jabber-message-default-message
, returns
“Message from person”, where person is the name of the
person if specified in the roster, otherwise the JID.
All message alert hooks take the same arguments plus the additional proposed-alert, which is the result of the specified message function.
[1] Logically it should be
jabber-alert-message-message-function
, but that would be
really ugly.