Next: , Previous: Extending service discovery, Up: Hacking and extending



16.6 Chat printers

Chat printers are functions that print a certain aspect of an incoming message in a chat buffer. Included are functions for printing subjects (jabber-chat-print-subject), bodies (jabber-chat-print-body, and jabber:x:oob-style URLs (jabber-chat-print-url). The functions in jabber-chat-printers are called in order, with the entire <message/> stanza as argument, and are expected to call insert if they have anything to add.

For MUC, the functions in jabber-muc-printers are prepended to those in jabber-chat-printers.

Body printers are a subgroup of chat printers. They are exclusive; only one of them applies to any given message. The idea is that “higher-quality” parts of the message override pieces included for backwards compatibility. Included are jabber-muc-print-invite and jabber-chat-normal-body; functions for XHTML-IM and PGP encrypted messages may be written in the future. The functions in jabber-body-printers are called in order until one of them returns non-nil.