1 This is jabber.info, produced by makeinfo version 6.7 from jabber.texi.
3 This manual is for jabber.el, version 0.8.0.
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Magnus Henoch, Tom
8 Permission is granted to make and distribute verbatim copies or
9 modified versions of this manual, provided the copyright notice and
10 this permission notice are preserved on all copies.
11 INFO-DIR-SECTION Emacs
13 * jabber.el: (jabber). Emacs XMPP (Jabber) client
17 File: jabber.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir)
22 This manual is for jabber.el, version 0.8.0.
24 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Magnus Henoch, Tom
27 Permission is granted to make and distribute verbatim copies or
28 modified versions of this manual, provided the copyright notice and
29 this permission notice are preserved on all copies.
36 * Composing messages::
39 * Personal information::
44 * Typing notifications::
45 * Roster import and export::
48 * Hacking and extending::
55 File: jabber.info, Node: Introduction, Next: Basic operation, Prev: Top, Up: Top
60 jabber.el is an XMPP (Jabber) client running under Emacs. For more
61 information on the open instant messaging protocol, please visit
64 As a XMPP client, jabber.el is mostly just a face in the crowd,
65 except that it uses buffers where GUI clients have windows. There is a
66 roster buffer, and to chat with someone you open a chat buffer, and
67 there are buffers for interaction with servers and services. Then
68 again, jabber.el delivers excellent console performance and customizable
69 hooks (if you have speech synthesizer software, hook it up to your
72 jabber.el does not yet support PGP encryption, sending and receiving
73 roster items, and various other things.
80 File: jabber.info, Node: Contacts, Up: Introduction
85 * There is a web page at <http://emacs-jabber.sf.net/>.
87 * There is a Sourceforge project page at
88 <http://sourceforge.net/projects/emacs-jabber>, with bug and patch
91 * There is a mailing list:
92 <emacs-jabber-general@lists.sourceforge.net>,
93 <https://lists.sourceforge.net/lists/listinfo/emacs-jabber-general>,
94 <http://dir.gmane.org/gmane.emacs.jabber.general>
96 * There is a chat room, 'jabber.el@conference.jabber.se'. If you
97 have successfully connected, you can join it by typing 'M-x
98 jabber-muc-join' and entering the address.
101 File: jabber.info, Node: Basic operation, Next: Groupchat, Prev: Introduction, Up: Top
106 This chapter is intended as an introduction to basic usage of jabber.el.
107 If you have used XMPP before and are familiar with the terminology, you
108 might find it a bit too basic--in that case, just skim it, making sure
109 to pick up the commands mentioned.
111 I'll assume that you have already successfully installed jabber.el;
112 if not, consult the 'README' file. Also, make sure you have '(require
113 'jabber)' or '(load "jabber-autoloads")' in your '.emacs'.
115 There are a handful of global keybindings for common commands. They
116 start with 'C-x C-j', and you can get a list of them by typing 'C-x C-j
121 * Do you have a Jabber account?::
122 * Registering an account::
126 * Presence subscription::
130 File: jabber.info, Node: Do you have a Jabber account?, Next: Registering an account, Up: Basic operation
132 2.1 Do you have a Jabber account?
133 =================================
135 Jabber has become rather popular as an instant messaging technology.
136 Several sites use it, but often not under the names "Jabber" or "XMPP".
139 * Google Talk uses Jabber. If you have a Gmail address, you can use
140 it as a Jabber ID. *Note Account settings::, for Google-specific
143 * LJ Talk (of Livejournal) uses Jabber. Your Jabber ID is
144 'LJUSERNAME@livejournal.com'.
147 File: jabber.info, Node: Registering an account, Next: Connecting, Prev: Do you have a Jabber account?, Up: Basic operation
149 2.2 Registering an account
150 ==========================
152 If you do not yet have a Jabber account, you can register one. The
153 registration processes for various servers differ, but many servers
154 support so-called "in-band registration", which is described in this
157 To register an account, type 'C-u M-x jabber-connect' and enter your
158 desired JID in the form 'USERNAME@SERVER'. You will be presented with a
159 registration form to fill out and send. There the username you chose
160 will be prefilled. After registration, you can connect to the server as
164 File: jabber.info, Node: Connecting, Next: Chatting, Prev: Registering an account, Up: Basic operation
169 Now, type 'C-x C-j C-c' and enter your JID and password. If you
170 successfully connect, jabber.el will download your roster and display it
171 in a buffer called '*-jabber-roster-*'.
173 By default, you will appear as "online" to your contacts. To change
174 this to e.g. "away", type 'M-x jabber-send-presence' or 'C-x C-j C-p'.
175 *Note Presence::, for more information.
177 To disconnect, type 'M-x jabber-disconnect' or 'C-x C-j C-d'. Use
178 'M-x jabber-disconnect-one' to disconnect just one account (or just type
181 If you don't want to type your JID every time you connect, you can
182 save it in the variable 'jabber-account-list'. *Note Account
183 settings::. If you configure more than one account, all of them will be
184 connected when you type 'C-x C-j C-c', as that key is bound to
185 'jabber-connect-all'. To connect only one account, possibly one that's
186 not in your list, type 'M-x jabber-connect' or 'C-u C-x C-j C-c'.
189 File: jabber.info, Node: Chatting, Next: Presence, Prev: Connecting, Up: Basic operation
194 There are several ways to open a chat buffer. The shortest way is to
195 put point over the person you want to chat with in the roster display
198 You can also use the function 'jabber-chat-with'. This function is
199 bound to 'C-x C-j C-j' in the global keymap. You will be asked to enter
200 a JID in the minibuffer. You can also enter the roster name of one of
201 your contacts. All JIDs and names in your roster can be tab-completed.
203 You can also use menus to access commands. In the roster display,
204 you can access several menus through keystrokes or mouse clicks. You
205 can bring one big menu up by pressing the second mouse button, or you
206 can bring up the "chat menu" by typing 'C-c C-c'. If you do the latter
207 while point is on a roster entry, that entry will be the default value
208 when you are asked for whom to chat with.
210 Now, try opening a chat with someone. A buffer named
211 '*-jabber-chat-:-PERSON-*' will be created and selected. Type your
212 message at the end of the buffer, and hit 'RET' to send it. To include
213 a newline in your message, use 'C-j'.
215 When you receive a message from someone, you will see a red indicator
216 in the mode line. You can click this indicator with the mouse, or type
217 'C-x C-j C-l' to switch to the relevant buffer. *Note Tracking
221 File: jabber.info, Node: Presence, Next: Presence subscription, Prev: Chatting, Up: Basic operation
226 "Presence" is the Jabber term for letting other people know that you are
227 online, and additionally how "available" you are. There are three
228 elements to presence: availability state (called "show"), status
229 message, and priority.
231 Your show state may either be empty (meaning simply "online"), or one
232 of 'away', 'xa', 'dnd' and 'chat', meaning "away", "extended away" (i.e.
233 away for an extended period), "do not disturb", and "free for chat",
234 respectively. This information is available to everyone subscribing to
235 your presence, but technically it does not restrict anyone's actions.
236 You can chat with people even if you claim to be away.
238 The status message is a short text complementing your show status,
239 such as "at home", "working", "phone", "playing games" or whatever you
240 want. It is sent to everyone subscribing to your presence, but not all
241 clients prominently display it to the user.
243 The priority is only interesting if you are running more than one
244 Jabber client at a time accessing the same account. *Note Resources and
247 To set your presence, use the function 'jabber-send-presence' (bound
248 to 'C-x C-j C-p'). It can be called both interactively and in Lisp
249 code. For the latter case, use something like '(jabber-send-presence
250 "away" "idle for 10 minutes" 10)'. There are a few shortcuts:
252 Send "away" presence (with prefix argument, specify status text)
254 Send "extended away" presence (with prefix argument, specify status
257 Send default presence (see below)
259 By default, jabber.el sets your presence when you connect. If you
260 want it not to do that, remove 'jabber-send-current-presence' from
261 'jabber-post-connect-hooks'. If you want to change the presence that is
262 sent, change the variables 'jabber-default-show',
263 'jabber-default-status' and 'jabber-default-priority'.
265 With jabber.el, you can set your presence remotely. *Note Ad-Hoc
270 * Resources and priority::
271 * Directed presence::
274 File: jabber.info, Node: Resources and priority, Next: Directed presence, Up: Presence
276 2.5.1 Resources and priority
277 ----------------------------
279 Every connection to an account has a specific name, a "resource". The
280 account itself has a JID of the form 'USERNAME@SERVER' (a "bare JID"),
281 but the connections have JIDs of the form 'USERNAME@SERVER/RESOURCE' (a
282 "full JID"). You can choose the resource name yourself by entering a JID
283 of the latter form at the connection prompt (*note Connecting::), or by
284 configuring it in 'jabber-account-list' (*note Account settings::)
286 Each session has a "priority". The priority determines what happens
287 when a message is sent to the bare JID (i.e. without specifying what
288 connection should receive message). Such messages are delivered to the
289 connection with the highest non-negative priority value. If there are
290 no connections, or if all connections have negative priority, the
291 message is either stored on the server for later delivery or bounced to
292 the sender, depending on the server configuration.
294 If there are several connections with the same priority, the
295 behaviour depends on the server. Some server implementations deliver
296 the message to all such connections, while others choose one connection
297 depending on certain rules.
299 Note that these rules do not apply when a message is sent to a full
300 JID. Such messages are sent to the specified resource, if it is still
301 connected, and otherwise treated as messages to the bare JID. In the
302 chat buffers of jabber.el, messages are sent to whatever JID the last
303 message came from (usually a full JID), or to the bare JID if no message
304 has been received yet. Other clients may have different behaviour.
307 File: jabber.info, Node: Directed presence, Prev: Resources and priority, Up: Presence
309 2.5.2 Directed presence
310 -----------------------
312 You can send "directed presence" with 'M-x
313 jabber-send-directed-presence'. This is mostly useful to manage
314 transports--sending directed presence is a way to turn them on and off.
315 You can also send directed presence to an annoying contact to appear as
316 away or offline to that contact. Note, however, that in both of these
317 cases, all subscribed entities will get your next global presence
321 File: jabber.info, Node: Presence subscription, Next: Roster buffer, Prev: Presence, Up: Basic operation
323 2.6 Presence subscription
324 =========================
326 Having permission to view the presence status of a person is called
327 "subscribing to his presence". Presence subscription between two
328 persons can be asymmetric. Subscription state is shown in the roster
329 display by arrows (*note Customizing the roster buffer::). A
330 left-pointing arrow means that the contact can see your presence
331 ("from"). A right-pointing arrow means that you can see the contact's
332 presence ("to"). The most common case is mutual subscription, a
333 double-ended arrow ("both").
335 When jabber.el receives a presence subscription request, it will
336 present it to you in a chat buffer, and offer you to choose subscription
337 mode and send a subscription request back to that person. The "Mutual"
338 button accepts the request and sends a reciprocal request.(1) The
339 "One-way" button accepts the request, but doesn't ask for a subscription
340 in return. The "Decline" button declines the request.
342 To request subscription to someone, type 'M-x
343 jabber-send-subscription-request'. You will be prompted for the JID to
344 send it to. This command can also be accessed through the Roster menu,
345 by typing 'C-c C-r' in the roster buffer. After that, you will probably
346 want to give the contact a more readable name. The command for that is
347 'jabber-roster-change', which is also available in the Roster menu or by
348 typing 'e' on a person in the roster buffer.
350 ---------- Footnotes ----------
352 (1) If this request is superfluous, the server will drop it without
353 bothering the contact.
356 File: jabber.info, Node: Roster buffer, Prev: Presence subscription, Up: Basic operation
358 2.7 The roster buffer
359 =====================
361 The roster buffer is called '*-jabber-roster-*'. It simply contains a
362 list of the contacts on your roster. If you have several accounts
363 connected, contacts will be grouped by account.
365 In the roster buffer, any command which requires a JID will default
366 to the JID under point when called. These commands can be called
367 through either keyboard menus or mouse menus. To open a menu with the
368 mouse, simply press the second mouse button over the JID in question.(1)
369 This will bring up a menu with all available actions. The keyboard
370 menus are split into categories: Chat, Roster, Information, MUC
371 (Multi-User Chat, or groupchat) and Services, opened by 'C-c C-c', 'C-c
372 C-r', 'C-c C-i', 'C-c C-m' and 'C-c C-s', respectively.
374 A list of keybindings is displayed at the top of the roster buffer.
375 You can turn it off by setting 'jabber-roster-show-bindings' to nil.
377 You can call 'jabber-display-roster' (bound to 'g') to redisplay your
378 roster according to changed preferences (*note Customizing the roster
379 buffer::). This will not refetch your roster from the server.
380 Refetching the roster is usually not needed, since updates are pushed to
381 clients automatically.
383 You can choose not to have the roster updated automatically on
384 presence changes (*note Presence alerts::). In that case, you need to
385 call 'jabber-display-roster' manually.
387 Please note, that by default offline contacts showed in roster as any
388 others. To hide them, you can use 'o' in roster buffer. To permanently
389 hide them, customize 'jabber-show-offline-contacts' variable.
391 ---------- Footnotes ----------
393 (1) For some reason, mouse menus don't work in XEmacs. Patches are
397 File: jabber.info, Node: Groupchat, Next: Composing messages, Prev: Basic operation, Up: Top
402 The groupchat menu can be accessed by typing 'C-c C-m' in the roster
403 buffer. You can also type the commands directly, as will be shown here.
405 To join a groupchat, type 'M-x jabber-muc-join'. You will be
406 prompted for the groupchat to join, and your nickname in the groupchat.
407 This nickname doesn't need to have any correlation to your JID; in fact,
408 groupchats are usually (but not always) configured such that only
409 moderators can see your JID. You can change your nickname with 'M-x
410 jabber-muc-nick'. *Note Configuration::, for setting default nicknames.
412 When trying to join a room, jabber.el first sends a service discovery
413 info request to the room, to find out whether it exists and what
414 features are enabled (in particular whether the room is
415 password-protected). However, this can cause problems with some buggy
416 MUC services (or services that respond in a way that jabber.el doesn't
417 expect). A workaround for that is to set
418 'jabber-muc-disable-disco-check' to 't'; however, the bug should be
421 Groupchat messages will be displayed in a buffer called
422 '*-jabber-groupchat-:-GROUPCHAT-*'. By default, the buffer name is
423 based on the JID of the chat room. If you want a shorter name, you can
424 add the chat room to your roster and give it a name, using the command
425 'M-x jabber-roster-change'. The groupchat buffer works much like the
426 chat buffer. It has its own class of alerts (*note Customizing
427 alerts::), and uses activity tracking (*note Tracking activity::).
429 Also, to save from repeating unnesesary typing you can press 'Tab'
430 key to complete nick of a groupchat member that you are talking with.
431 You can customize your form of personal talking in MUC
432 ('jabber-muc-completion-delimiter') and form of personal talking to you
433 ('jabber-muc-looks-personaling-symbols')--see "jabber-chat"
434 customization group. Defaults are sane, so it is unlikely that you
435 would want to change this, but... it is Emacs!
437 By default presence updates are logged in the groupchat buffer.
438 Presence updates include announcements when a member joins or leaves a
439 room, as well as moderator actions, like kicks or bans. These
440 announcements can clutter up the group discussion, especially when other
441 participants using mobile clients experiencing frequent network
442 disconnect and reconnects. Which of these announcements and how they
443 are rendered can be configured (*Note Presence announcements::).
445 To change the topic of a groupchat, type 'M-x jabber-muc-set-topic'.
446 The current topic is shown in the header line.
448 To leave a groupchat, type 'M-x jabber-muc-leave'.
450 If you are the owner of a groupchat, you can change its configuration
451 by typing 'M-x jabber-muc-get-config'. A configuration form will be
452 rendered in new buffer.
454 To see which people are in a groupchat, type 'M-x jabber-muc-names'.
455 This gives a list of nicknames, "affiliations", and possibly JIDs
456 according 'jabber-muc-print-names-format', sorted by "roles". *Note MUC
457 Administration::, for the meaning of roles and affiliations.
462 * Presence announcements::
465 * MUC Administration::
468 File: jabber.info, Node: Configuration, Next: Invitations, Up: Groupchat
473 You can configure jabber.el to use a certain nickname for a certain
474 room, or to automatically join a certain room when you connect. You can
475 do this either by storing bookmarks on the server or by setting Emacs
478 Type 'M-x jabber-edit-bookmarks' to add bookmarks. You can specify
479 the JID of the conference, the name of the conference (not used by
480 jabber.el), whether to automatically join the room, your desired
481 nickname (or leave empty), and the room password (or leave empty).
483 The default nickname for groupchats is the username part of your JID.
484 If you don't use bookmarks, you can set different nicknames for
485 different groups by customizing 'jabber-muc-default-nicknames'. There
486 you specify the JID of the group, and your preferred nickname.
488 Automatically joining certain rooms when connecting can be
489 accomplished by setting 'jabber-muc-autojoin' to a list containing the
490 JIDs of the rooms you want to enter. To disable this feature, remove
491 'jabber-muc-autojoin' from 'jabber-post-connect-hooks'.
493 Please note, that 'jabber-muc-default-nicknames' and
494 'jabber-muc-autojoin' are machine-local, but apply to _all_ accounts--if
495 you connect several accounts, both will try to connect to the same chat
496 rooms, or use the same nickname. This will lead to confusion.
499 File: jabber.info, Node: Presence announcements, Next: Invitations, Prev: Configuration, Up: Groupchat
501 3.2 Presence announcements
502 ==========================
504 To limit, highlight, or deemphasize presences announcement messages,
505 customize the variable 'jabber-muc-decorate-presence-patterns'.
507 'jabber-muc-decorate-presence-patterns' is a list of pairs consisting
508 of a regular expression and a face. When a presence announcement
509 matches a regular expression pattern, it will be displayed with the
510 associated face. If the face is 'nil', the announcement will not be
511 added to the groupchat. For example, the customization:
513 '(jabber-muc-decorate-presence-patterns
514 '(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$")
515 ("." . jabber-muc-presence-dim)))
517 This suppresses display of membership changes (join and leave events)
518 and deemphasizes moderator action to set them off from surrounding chat
522 File: jabber.info, Node: Invitations, Next: Private messages, Prev: Configuration, Up: Groupchat
527 You can invite someone to a groupchat with 'M-x jabber-muc-invite' (also
528 available in the MUC menu). Pay attention to the order of the
529 arguments--as both users and rooms are just JIDs, it is technically
530 possible to invite a room to a user, but that's probably not what you
533 When you receive an invitation, it appears in the chat buffer along
534 with two buttons, "Accept" and "Decline". Pressing "Accept" enters the
535 room, as you would expect. Pressing "Decline" gives you an opportunity
536 to state the reason why you're not joining.
539 File: jabber.info, Node: Private messages, Next: MUC Administration, Prev: Invitations, Up: Groupchat
544 You can open a private chat with a participant in a chat room with 'M-x
545 jabber-muc-private' (or by using the MUC menu). This creates a buffer
546 with the name '*-jabber-muc-priv-GROUP-NICKNAME-*' (customizable by
547 'jabber-muc-private-buffer-format'), which behaves mostly like an
548 ordinary chat buffer. This buffer will also be created if someone sends
549 a private message to you.
551 Private MUC messages use the same alerts as normal chat messages.
552 *Note Message alerts::.
555 File: jabber.info, Node: MUC Administration, Prev: Private messages, Up: Groupchat
560 Administration of a MUC room mostly consists of managing roles and
561 affiliations. Roles are temporary, and apply until the user leaves the
562 room. Affiliations are permanent, and based on JIDs.
567 If you have moderator privileges, you can change the role of a
568 participant with 'M-x jabber-muc-set-role'. Kicking means setting the
569 role to "none". Granting and revoking voice are "participant" and
570 "visitor", respectively. "moderator" gives moderator privileges,
573 The possible roles are:
576 Has voice, can change other people's roles.
582 Doesn't have voice (can't send messages to everyone, but can send
591 If you have admin or owner privileges, you can change the affiliation of
592 a user with 'M-x jabber-muc-set-affiliation'. Affiliation is
593 persistent, and based on JIDs. Depending of your affiliation and the
594 MUC implementation, you might not be allowed to perform all kinds of
595 changes, and maybe not in one step.
600 Can destroy room, appoint admins, make people members, ban people.
603 Can make people members or ban people.
606 Can enter the room, and has voice by default.
609 Rights depend on room configuration. The room might be
610 members-only, or grant voice only to members.
613 Banned from the room.
616 File: jabber.info, Node: Composing messages, Next: File transfer, Prev: Groupchat, Up: Top
621 The chat buffer interface can be inconvenient for some purposes. As you
622 can't use 'RET' to insert a newline (use 'C-j' for that), writing a
623 longer message can be painful. Also, it is not possible to include a
624 subject in the message, or send the message to multiple recipients.
626 These features are implemented by the message composing tool. Type
627 'M-x jabber-compose' to start it. In the buffer that comes up, you can
628 specify recipients, enter a subject, and type your message.
631 File: jabber.info, Node: File transfer, Next: Services, Prev: Composing messages, Up: Top
636 jabber.el has limited support for file transfer. The most important
637 limit is that files sent and received are kept in buffers, so Emacs must
638 be able to allocate enough memory for the entire file, and the file size
639 must be smaller than the maximum buffer size.(1)
641 jabber.el is able to exchange files with most Jabber clients (and
642 also some MSN transports), but notably not with the official Google Talk
643 client. The Google Talk client uses a different file transfer protocol
644 which, at the time of this release, has not been published.
651 ---------- Footnotes ----------
653 (1) The maximum buffer size depends on in the variable
654 'most-positive-fixnum'. On 32-bit systems, this is 128 or 256
655 megabytes, depending on your Emacs version.
658 File: jabber.info, Node: Receiving files, Next: Sending files, Up: File transfer
663 Receiving files requires no configuration. When someone wants to send a
664 file to you, you are asked (through 'yes-or-no-p') whether you want to
665 accept the file. If you answer yes, you get to choose where to save the
668 If the sender's client is correctly configured (this is often not the
669 case; see below), the file transfer will start. Currently, the only way
670 to watch the progress is to inspect the buffer of the file being
671 transfered; 'C-x C-b' is one way of doing that. *Note Listing Existing
672 Buffers: (emacs)List Buffers. When the transfer is done, the message
673 "FILE downloaded" appears in the echo area, and the buffer is killed.
675 If this doesn't happen, it is most likely the sender's fault. The
676 sender needs to have a public IP address, either directly, through port
677 forwarding (in which case the client needs to be configured with the
678 real public IP address), or through an XEP-0065 proxy. If you have
679 activated XML logging (*note Debug options::), you can see the IP
680 address that the other client is asking you to connect to there. Often
681 you will find that this is an internal IP address (often starts with
682 '192.168'). See the documentation of the sender's client for setting
686 File: jabber.info, Node: Sending files, Prev: Receiving files, Up: File transfer
691 To send a file to someone, you need an XEP-0065 proxy.(1) If your
692 Jabber server hosts such a proxy, it will be found automatically,
693 otherwise it needs to be manually configured.
695 You can check whether your Jabber server has a proxy with 'M-x
696 jabber-get-disco-items'; see *note Service discovery::.
698 To configure a proxy manually, customize the variable
699 'jabber-socks5-proxies'. Putting 'proxy.jabber.se' there should work.
700 Type 'M-x jabber-socks5-query-all-proxies' to see if the proxies answer.
702 Now, you can type 'M-x jabber-ft-send' to send a file to someone.
703 You need to enter the correct full JID, including resource, to get this
704 right. If the contact is logged in with only one client, and you can
705 see it online, just typing the JID or roster name is enough. If you run
706 the command from a chat buffer, the JID of the contact is given as the
709 If the contact has several clients online, you probably want to send
710 the file to a particular one. If you run this command from within a
711 chat buffer, the default target will be the one that last sent a message
712 to you. If you just type a bare JID or a roster name, the client with
713 the highest priority will get the file.
715 If the contact accepts the file, and the contact's client succeeds in
716 connecting to the proxy, jabber.el will send the file through the proxy.
717 During this time, your Emacs will be blocked, so you might want to avoid
718 sending large files over slow connections.
720 ---------- Footnotes ----------
722 (1) This requirement is not inherent in the protocol, only in the
723 current file transfer implementation of jabber.el, and in Emacs versions
727 File: jabber.info, Node: Services, Next: Personal information, Prev: File transfer, Up: Top
732 Not every Jabber entity is a physical person. There are many automatic
733 entities, called servers, services, components, agents, transports and
734 other names. The use of these is described here.
736 The functions described in this chapter use "browse buffers". Browse
737 buffers are named '*-jabber-browse-:-SERVICE-*', sometimes with a
738 numerical suffix. The different menus have the same keybindings as in
739 the roster buffer, and if you call a function operating on a JID while
740 point is over a JID, that JID will be the default value, so you don't
741 have to type it or copy it yourself.
743 You can change the buffer name template by customizing the variable
744 'jabber-browse-buffer-format'.
755 File: jabber.info, Node: Commands, Next: Your home server, Up: Services
760 A small number of commands is used for almost all interaction with
761 Jabber services. Essentially, they are all the same: you request a form
762 from the server, fill it in, and send it back.
764 Most of these commands are available under the Service menu, which is
765 opened by typing 'C-c C-s'. Service discovery is under the Info menu
766 instead, which is available under 'C-c C-i'.
773 * Service discovery::
777 File: jabber.info, Node: Registration, Next: Search, Up: Commands
782 You can get a registration form for a service by typing 'M-x
783 jabber-get-register' and entering the JID of the service. On success,
784 you get a single-stage form to fill in.
786 There are two buttons at the bottom of the form, "Submit" and "Cancel
787 registration". "Submit" does what you would expect it to, but "Cancel
788 registration" cancels any existing registration with the service.
789 Whichever of them you choose, you get a message in the echo area
790 informing whether the operation succeeded.
793 File: jabber.info, Node: Search, Next: Ad-Hoc Commands, Prev: Registration, Up: Commands
798 You can get a search form for a service by typing 'M-x
799 jabber-get-search'. This gives you a single-stage form to fill in.
800 After you press the "Submit" button at the bottom, the search results
801 will be displayed in the same buffer.
804 File: jabber.info, Node: Ad-Hoc Commands, Next: Service discovery, Prev: Search, Up: Commands
806 6.1.3 Ad-Hoc Commands
807 ---------------------
809 jabber.el supports a subset of XEP-0050, the standard for Ad-Hoc
810 Commands. As the name implies, this can be used for just about
811 anything. In particular, it is used not only by services, but also by
812 clients (e.g. Psi, and jabber.el itself).
814 To find which commands are available, run "Request command list"
815 ('jabber-ahc-get-list').(1)
817 To run a command from the list, put point over it and run "Execute
818 command" ('jabber-ahc-execute-command'), accepting the defaults for JID
819 and node. (If you already know those, you could of course enter them
822 What happens next depends on the command and the service. In some
823 cases, the service just responds that the command has been run. You may
824 also get a form to fill out. This form may have multiple stages, in
825 which case there are "Next" and "Previous" buttons for navigating
826 between stages. You may also see "Complete", which runs the command
827 skipping any remaining stages of the form, and "Cancel", which cancels
830 Currently, jabber.el uses ad-hoc commands for setting presence
831 remotely. If you realize that you forgot to set your client to "away"
832 with a low priority, you can do it remotely from any JID from
833 'jabber-account-list'. So, you can add disabled JIDs in
834 'jabber-account-list' to allow them control your presence.(2)
836 ---------- Footnotes ----------
838 (1) This is the same thing as a disco items request to the node
839 'http://jabber.org/protocol/commands'.
841 (2) Most Jabber servers also support kicking a client off the net by
842 logging in with another client with exactly the same resource.
845 File: jabber.info, Node: Service discovery, Next: Browsing, Prev: Ad-Hoc Commands, Up: Commands
847 6.1.4 Service discovery
848 -----------------------
850 Service discovery is used to find information about servers, services
851 and clients. There are two kinds of requests: find "info" about a
852 Jabber entity--i.e. its identity and supported features--and find
853 "items" related to an entity, where the definition of "related" is left
854 to the entity itself.
856 The commands to execute such requests are 'jabber-get-disco-info' and
857 'jabber-get-disco-items', respectively. These commands can be accessed
858 from the Info menu, which is opened by typing 'C-c C-i'. The commands
859 accept a JID and optionally a "node".
861 The result of such a command is displayed in a browse buffer. For an
862 info request, the result just lists the identities and features of the
863 entity. For an item request, the related items are listed. The items
864 may be JIDs, or JIDs with a node. If you put point on one of the items,
865 its JID and node will be the default value for any Jabber command.
867 If you think that the interface to service discovery is awkward and
868 should be replaced with something better, you are completely right.
871 File: jabber.info, Node: Browsing, Prev: Service discovery, Up: Commands
876 Before service discovery, browsing was the way to find information about
877 Jabber entities. Nowadays it is all but superseded, but jabber.el still
878 supports it. You can use it by typing 'M-x jabber-get-browse'. It
879 works much like service discovery.
882 File: jabber.info, Node: Your home server, Next: Transports, Prev: Commands, Up: Services
887 You can interact with your Jabber server to change your password or
888 remove your account. Both of these can be accomplished by typing 'M-x
889 jabber-get-register' and typing the JID of your server; *note
893 File: jabber.info, Node: Transports, Next: User directories, Prev: Your home server, Up: Services
895 6.3 Transports to other IM networks
896 ===================================
898 Some Jabber services make it possible to communicate with users on other
899 instant messaging networks (e.g. MSN, ICQ, AIM), in effect turning your
900 Jabber client into a multi-protocol client. These are called "gateways"
901 or "transports". They work by impersonating you on the legacy network;
902 therefore you need to provide your username and password through
905 6.3.1 Finding a transport
906 -------------------------
908 To use such a transport, you first need to find one, obviously.
909 Sometimes your home server provides the transports you need, but you are
910 not limited to those; in principle you can use any transport on the
911 Jabber network. Some transports only accept local users, though.
913 Transports are generally mentioned on the web page of the Jabber
914 server in question. You can also find transports from within the
915 client; *note Service discovery::.
917 6.3.2 Registering with a transport
918 ----------------------------------
920 To register with a transport, type 'M-x jabber-get-register' and enter
921 the JID of the transport. This will open a registration form where you
922 get to fill in your login information; *note Registration::. You can
923 later use this same form to change the information or cancel your
926 After you have registered, the transport will request presence
927 subscription. It needs that to know when you are online, and
928 synchronize your presence on the legacy network.
933 Once you are registered, the transport will transfer the contact list
934 from the legacy service. From the Jabber side, it appears as if lots of
935 people suddenly request presence subscription to you. This is somewhat
936 inconvenient, but it is currently the only way that the transport can
937 influence your Jabber contact list, as it is an entity external to your
940 When you have accepted these presence subscriptions, the contacts
941 from legacy networks appear as if they were Jabber contacts.
946 Some legacy networks have a global database of users, and some
947 transports support searching that database. In that case, you can
948 search for other users with 'M-x jabber-get-search'; *note Search::.
950 ---------- Footnotes ----------
952 (1) Of course, jabber.el could do more to alleviate this
956 File: jabber.info, Node: User directories, Next: MUC services, Prev: Transports, Up: Services
961 There are some Jabber user directories, usually abbreviated JUDs. The
962 most well-known one is 'users.jabber.org'. You can register with such a
963 directory to let other people find you (*note Registration::), and you
964 can search the directory (*note Search::).
967 File: jabber.info, Node: MUC services, Prev: User directories, Up: Services
972 MUC services (Multi-User Chat, chat rooms) are usually not operated by
973 these commands, but by commands specific to the MUC protocol; *note
974 Groupchat::. However, some MUC services offer nickname registration
975 through the registration protocol (*note Registration::), and other
976 commands; *note Ad-Hoc Commands::.
979 File: jabber.info, Node: Personal information, Next: Avatars, Prev: Services, Up: Top
981 7 Personal information
982 **********************
984 The Jabber way of handling personal information (name, addresses, phone
985 numbers, etc) is "vCards" encoded in XML.(1) You can get information
986 about a user by running 'M-x jabber-vcard-get', 'M-x
987 jabber-muc-vcard-get' if you in MUC (also available in the MUC menu),
988 and you can edit your own information by running 'M-x
991 The form for editing your information can be slightly confusing--you
992 are allowed to enter any number of addresses, phone numbers and e-mail
993 addresses, each of which has a set of orthogonal properties. You can
994 add and remove items with the '[INS]' and '[DEL]' buttons, respectively.
996 This is also where you set your avatar (*note Avatars::). The size
997 of your avatar file is limited to 8 kilobytes.
999 ---------- Footnotes ----------
1001 (1) *Note XEP-0054::.
1004 File: jabber.info, Node: Avatars, Next: Time queries, Prev: Personal information, Up: Top
1009 jabber.el supports viewing and publishing avatars according to XEP-0153,
1010 vCard-Based Avatars. By default, if you have an avatar in your vCard
1011 (*note Personal information::), it will be published for others to see,
1012 and if other people publish their avatars, they will be displayed in the
1013 roster buffer and in the header line of chat buffers, if your Emacs can
1014 display images. Otherwise, jabber.el will not fetch avatars at all.
1016 To disable retrieval of other people's avatars, set
1017 'jabber-vcard-avatars-retrieve' to nil. To disable publishing of your
1018 own avatar, set 'jabber-vcard-avatars-publish' to nil. To disable
1019 avatars in chat buffer header lines, set
1020 'jabber-chat-buffer-show-avatar' to nil.
1022 There are a number of restrictions on avatar images in the
1023 specification. Most of them are not enforced by jabber.el.
1024 * The image should be smaller than 8 kilobytes; this is enforced by
1026 * The image height and width should be between 32 and 96 pixels; the
1027 recommended size is 64 by 64 pixels.
1028 * The image should be square.
1029 * The image should be in either PNG, GIF, or JPEG format. (jabber.el
1030 will behave incorrectly if the image is not in a format supported
1033 Avatars are cached in the directory specified by
1034 'jabber-avatar-cache-directory', by default
1035 '~/.emacs.d/jabber-avatar-cache/'.(1) The cache is never cleaned, so
1036 you might want to do that yourself from time to time.
1038 ---------- Footnotes ----------
1040 (1) The default directory used to be '~/.jabber-avatars'. If this
1041 directory already exists, it will be used.
1044 File: jabber.info, Node: Time queries, Next: Useful features, Prev: Avatars, Up: Top
1049 With 'M-x jabber-get-time', you can ask what time an entity (client,
1050 server or component) thinks it is, and what time zone it thinks it is
1053 You can query a server about when a certain user was last seen
1054 online. Use 'M-x jabber-get-last-online' for that.
1056 You can also ask a client about how long a user has been idle with
1057 'M-x jabber-get-idle-time'. Not all clients answer such queries, e.g.
1058 jabber.el doesn't. This command can also tell the uptime of a server or
1061 The first of these commands uses the old Entity Time protocol (*note
1062 XEP-0090::). It has been superseded by XEP-0202, but jabber.el doesn't
1063 implement the newer protocol yet. The latter two commands use the Last
1064 Activity protocol (*note XEP-0012::).
1067 File: jabber.info, Node: Useful features, Next: Message history, Prev: Time queries, Up: Top
1072 jabber.el includes a number of features meant to improve the user
1073 interface and do other useful things.
1081 * Tracking activity::
1084 * Gmail notifications::
1085 * Saving groups roll state::
1088 File: jabber.info, Node: Autoaway, Next: Modeline status, Up: Useful features
1093 It is possible to automatically set your status to "away" or "xa" when
1094 you haven't used your computer for a while. This lets your contacts
1095 know that you might not answer immediately. You can customize timeouts
1096 ('jabber-autoaway-timeout', 'jabber-autoaway-xa-timeout'), statuses
1097 ('jabber-autoaway-status', 'jabber-autoaway-xa-status') and priorityes
1098 ('jabber-autoaway-priority', 'jabber-autoaway-xa-priority') to set.
1100 To activate this feature, add 'jabber-autoaway-start' to
1101 'jabber-post-connect-hooks', e.g:
1102 (add-hook 'jabber-post-connect-hooks 'jabber-autoaway-start)
1104 There are different methods to find how long you have been "idle".
1105 The method(s) to use is specified by 'jabber-autoaway-methods'
1106 (obsoleted 'jabber-autoaway--method' will also work). The value of this
1107 variable should be a list functions that returns the number of seconds
1108 you have been idle (or nil on error). Minimum of values, returned by
1109 these functions, is used as "idle" time, so default should works well.
1110 Three functions are provided (all used by default).
1112 * 'jabber-current-idle-time' is used if your Emacs has the
1113 'current-idle-time' function (which was introduced in Emacs 22).
1114 Note that this method only measures the time since you last
1115 interacted with Emacs, and thus disregards activity in other
1118 * 'jabber-xprintidle-get-idle-time' uses xprintidle (1) program, if
1119 found. You can also manually set 'jabber-xprintidle-program' to
1120 the correct file path. This method uses the same method as
1121 XScreensaver (http://www.jwz.org/xscreensaver) to find your idle
1124 * 'jabber-termatime-get-idle-time' used on GNU/Linux terminals. It
1125 uses the access time of the terminal device as a measure of idle
1128 ---------- Footnotes ----------
1130 (1) <http://www.dtek.chalmers.se/~henoch/text/xprintidle.html>
1133 File: jabber.info, Node: Modeline status, Next: Keepalive, Prev: Autoaway, Up: Useful features
1135 10.2 Modeline status
1136 ====================
1138 By typing 'M-x jabber-mode-line-mode' you toggle display of some status
1139 in mode lines. The information is your own presence status, and some
1140 numbers showing the status of your roster contacts. By default, there
1141 are three numbers, for "online" (chatty and online), "away" (away,
1142 extended away and do not disturb) and offline contacts.
1144 If you set 'jabber-mode-line-compact' to nil, you get a complete
1145 breakdown of presence status. That gives you six numbers indicating the
1146 number of chatty, online, away, extended away, dnd, and offline
1147 contacts, respectively.
1150 File: jabber.info, Node: Keepalive, Next: Reconnecting, Prev: Modeline status, Up: Useful features
1155 Sometimes network connections are lost without you noticing. This is
1156 especially true with Jabber, as it is quite reasonable to keep the
1157 connection open for a long time without either sending or receiving any
1160 On the other hand, the server may want to do the same kind of
1161 detection, and may expect the client to send something at regular
1164 If you want to detect a lost connection earlier, or make sure that
1165 the server doesn't drop your connection, you can use the keepalive
1166 functions. These come in two flavours: whitespace pings and XMPP pings.
1168 10.3.1 Whitespace pings
1169 -----------------------
1171 A "whitespace ping" is a single space character sent to the server.
1172 This is often enough to make NAT devices consider the connection
1173 "alive", and likewise for certain Jabber servers, e.g. Openfire. It
1174 may also make the OS detect a lost connection faster--a TCP connection
1175 on which no data is sent or received is indistinguishable from a lost
1178 Type 'M-x jabber-whitespace-ping-start' to start it, and 'M-x
1179 jabber-whitespace-ping-stop' to stop it. The former is in
1180 'jabber-post-connect-hooks' by default; *note Hooks::.
1182 The frequency of whitespace pings is controlled by the variable
1183 'jabber-whitespace-ping-interval'. The default value is once every 30
1189 These functions work by sending a ping request to your server once in a
1190 while (by default every ten minutes), and considering the connection
1191 lost if the server doesn't answer within reasonable time (by default 20
1194 Type 'M-x jabber-keepalive-start' to start it, and 'M-x
1195 jabber-keepalive-stop' to stop it. You may want to add
1196 'jabber-keepalive-start' to 'jabber-post-connect-hooks'; *note Hooks::.
1198 You can customize the interval and the timeout with the variables
1199 'jabber-keepalive-interval' and 'jabber-keepalive-timeout',
1202 You can also manually ping some client/server by using 'M-x
1203 jabber-ping'. Note that pong will be displayed according
1204 'jabber-alerts-info-messages-hooks' (default is echo in minibuffer).
1207 File: jabber.info, Node: Reconnecting, Next: Tracking activity, Prev: Keepalive, Up: Useful features
1212 jabber.el supports automatic reconnection to Jabber server(s) upon lost
1213 connection. By default it is off. To turn on, customize the
1214 'jabber-auto-reconnect' variable.
1216 This is of limited use if you have to type your password every time
1217 jabber.el reconnects. There are two ways to save your password: you can
1218 set it in 'jabber-account-alist' (*note Account settings::), and you can
1219 use 'password-cache.el', which is available in recent versions of Gnus
1220 and in Emacs 23. Note that you probably want to customize
1221 'password-cache-expiry' if you use the latter.
1224 File: jabber.info, Node: Tracking activity, Next: Watch buddies, Prev: Reconnecting, Up: Useful features
1226 10.5 Tracking activity
1227 ======================
1229 When you're working on something important you might want to delay
1230 responding to incoming messages. However, when you're done working,
1231 will you remember them? If you're anything like me, you'll have a lot
1232 of buffers in your Emacs session, and a Jabber chat buffer can easily
1235 When 'jabber-activity-mode' is enabled (by default, it is), Emacs
1236 keeps track of the buddies which have messaged you since last you
1237 visited their buffer, and will display them in mode line. As soon as
1238 you visit their buffer they disappear from the mode line, indicating
1239 that you've read their message.
1241 If your mode line fills over because of these notifications, you can
1242 customize 'jabber-activity-make-strings' to shorten them to the shortest
1243 possibly unambiguous form.
1245 If you try to exit Emacs while you still have unread messages, you
1246 will be notified and asked about this. If you don't like that, set
1247 'jabber-activity-query-unread' to nil.
1249 If you want to display the number of unread buffers in the frame
1250 title, set 'jabber-activity-count-in-title' to t. The format of the
1251 number can be changed through 'jabber-activity-count-in-title-format'.
1253 To hide activity notifications for some contacts, use
1254 'jabber-activity-banned' variable - just add boring JIDs (as regexps)
1257 For complete customizability, write a hook function for
1258 'jabber-activity-update-hook'. From that function, you can take action
1259 based on 'jabber-activity-jids', 'jabber-activity-mode-string', and
1260 'jabber-activity-count-string'.
1263 File: jabber.info, Node: Watch buddies, Next: Spell checking, Prev: Tracking activity, Up: Useful features
1268 Sometimes you might be waiting for a certain person to come online, and
1269 you don't want that occasion to get lost in the noise. To get an
1270 obtrusive message when that happens, type 'M-x jabber-watch-add' and
1271 select the person in question. You can enter a comment, to remember why
1272 you added the watch.
1274 You will get a message whenever that person goes from offline to
1275 online. jabber.el will remember this for the rest of your Emacs session
1276 (it's not saved to disk, though), but if you want to get rid of it, type
1277 'M-x jabber-watch-remove'.
1280 File: jabber.info, Node: Spell checking, Next: Gmail notifications, Prev: Watch buddies, Up: Useful features
1285 You can activate spell checking in a chat buffer with 'M-x
1286 flyspell-mode'. It will check only what you are currently writing, not
1287 what you receive or what you have already sent. You may want to add
1288 'flyspell-mode' to 'jabber-chat-mode-hook'.
1290 For more information about Emacs spell checking, *note Checking and
1291 Correcting Spelling: (emacs)Spelling.
1294 File: jabber.info, Node: Gmail notifications, Next: Saving groups roll state, Prev: Spell checking, Up: Useful features
1296 10.8 Gmail notifications
1297 ========================
1299 If you are connected to a Google Talk account, you can receive
1300 notifications when a new Gmail message arrives. Gmail notifications are
1301 enabled by adding the following line to your '.emacs':
1303 (add-hook 'jabber-post-connect-hooks 'jabber-gmail-subscribe)
1305 Default behavior is to display a message that mentions the number of
1306 received gmails. You can customize this behavior by providing your own
1307 'jabber-gmail-dothreads' function.
1311 (eval-after-load "jabber-gmail"
1312 '(defun jabber-gmail-dothreads (threads)
1313 "Process <mail-thread-info/> elements.
1314 THREADS is a list of XML sexps corresponding to <mail-thread-info/>
1316 See http://code.google.com/apis/talk/jep_extensions/gmail.html#response"
1317 (osd "gmail: %d" (length threads))))
1319 ;;; It's usually a good idea to have a shortcut for querying GTalk server.
1320 (global-set-key (kbd "<f9> g") 'jabber-gmail-query)
1322 ;;; The definition of `osd' function used by `jabber-gmail-dothreads'.
1323 ;;; `osd_cat' is shipped with the X OSD library
1324 ;;; [http://www.ignavus.net/software.html].
1325 (if (and (display-graphic-p) (file-executable-p "/usr/bin/osd_cat"))
1326 (defun osd (fmt &rest args)
1327 "Display message on X screen."
1328 (let ((opts "-p bottom -A center -l 1 \
1329 -f '-adobe-helvetica-bold-r-*-*-24-*-*-*-*-*-iso10646-1'")
1330 (msg (apply 'format (concat fmt "\n") args)))
1331 (start-process "osd" nil shell-file-name shell-command-switch
1332 (format "echo %s | osd_cat %s"
1333 (shell-quote-argument msg) opts))))
1334 (defalias 'osd 'message))
1337 File: jabber.info, Node: Saving groups roll state, Prev: Gmail notifications, Up: Useful features
1339 10.9 Saving groups roll state
1340 =============================
1342 You can save roster's groups rollup/rolldown state between sessions. To
1343 do this you need to add 'jabber-roster-save-groups' to
1344 'jabber-pre-disconnect-hook' and 'jabber-roster-restore-groups' to
1345 'jabber-post-connect-hooks', respectively.
1347 State saved in private storage on server-side (for each account).
1348 Note that state restoring working by rolling up groups, rolled up at
1349 state saving (by default, all groups rolled down). Also note that at
1350 now, 'jabber-pre-disconnect-hook' run only with 'jabber-disconnect' (not
1351 with 'jabber-disconnect-one').
1354 File: jabber.info, Node: Message history, Next: Typing notifications, Prev: Useful features, Up: Top
1359 If you want a record of messages sent and received, set
1360 'jabber-history-enabled' to t. If you also want record MUC groupchat
1361 messages, set 'jabber-history-muc-enabled' to t. Messages will be saved
1362 in one file per contact in the directory specified by the variable
1363 'jabber-history-dir' (the default is '~/.emacs.d/jabber-history'). If
1364 you prefer to store messages for all contacts in a single file, set
1365 'jabber-use-global-history' to 't' and set
1366 'jabber-global-history-filename' as required.(1)
1368 When you open a new chat buffer and have entries in your history
1369 file, the last few messages you recently exchanged with the contact in
1370 question will be inserted. You can control how many messages with
1371 'jabber-backlog-number' (by default 10), and how old messages with
1372 'jabber-backlog-days' (by default 3 days).
1374 If you want to see more messages, use the function
1375 'jabber-chat-display-more-backlog', available in the Chat menu. This is
1376 currently the only way to view the message history, apart from opening
1377 the history files manually.
1379 If you worry about your history file(s) size, you can enable history
1380 rotation feature by setting the variable
1381 'jabber-history-enable-rotation' to 't' (default is 'nil'). This
1382 feature "rotates" your history files according to the following rule:
1383 When 'jabber-history-size-limit' (in kilobytes) is reached, the
1384 HISTORY-FILE is renamed to 'HISTORY-FILE-NUMBER', where NUMBER is 1 or
1385 the smallest number after the last rotation.
1387 For example, suppose you set the 'jabber-history-size-limit' variable
1388 to 512 and you chat with your buddy 'foo@jabber.server' using the
1389 per-contact strategy to store history files. So, when the history file
1390 ('foo@jabber-server') reaches 512K bytes, it will be renamed to
1391 'foo@jabber-server-1' and 'foo@jabber-server' will be set empty. Next
1392 time 'foo@jabber-server' grows to 512K bytes, it will be saved as
1393 'foo@jabber-server-2' and so on. Although the example was presented
1394 with the per-contact history file strategy, history rotation works for
1395 both per-contact and global history logging strategies.
1397 If you also want to keep chat and groupchat buffers from growing too
1398 much, you can customize 'jabber-alert-message-hooks' and
1399 'jabber-alert-muc-hooks' by adding truncation upon receiving message
1400 ('jabber-truncate-chat' and 'jabber-truncate-muc', respectively). The
1401 truncation limit may be set by customizing the variable
1402 'jabber-log-lines-to-keep'.
1404 ---------- Footnotes ----------
1406 (1) Using a global history file used to be the default. If the file
1407 specified by 'jabber-global-history-filename' exists,
1408 'jabber-use-global-history' will default to 't' to support existing
1412 File: jabber.info, Node: Typing notifications, Next: Roster import and export, Prev: Message history, Up: Top
1414 12 Typing notifications
1415 ***********************
1417 There are two protocols for "contact is typing" notifications in Jabber.
1418 jabber.el supports both of them, displaying various information in the
1419 header line of chat buffers.
1424 The older protocol is called Message Events (*note XEP-0022::). Besides
1425 typing notification, it lets you know what happens to the messages you
1426 send. These states are possible:
1428 * 'In offline storage' (the user will receive it on next logon)
1430 * 'Delivered' to user's client (but not necessarily displayed)
1432 * 'Displayed' to user
1434 * User is 'typing a message'
1436 The first state is only reported by servers; the other three are
1437 reported by clients. jabber.el can report all three of them, and can
1438 display all four; not all clients support all states, though.
1440 If you don't want jabber.el to send out this information about you,
1441 set the variables 'jabber-events-confirm-delivered',
1442 'jabber-events-confirm-displayed', and/or
1443 'jabber-events-confirm-composing' to nil. You can make jabber.el not to
1444 request such information by customizing 'jabber-events-request-these'.
1449 The newer protocol is called Chat States (*note XEP-0085::). Rather
1450 than dealing with individual messages, it describes the state of the
1451 chat session between two people. The following states are possible:
1453 * Active (the default state, not displayed)
1459 * Paused (i.e., taking a short pause in composing)
1463 jabber.el can display all five states, but only ever sends "active"
1464 and "composing" itself.
1466 To customize sending of chat states, customize the variable
1467 'jabber-chatstates-confirm'.
1470 File: jabber.info, Node: Roster import and export, Next: XMPP URIs, Prev: Typing notifications, Up: Top
1472 13 Roster import and export
1473 ***************************
1475 Your roster is saved on the Jabber server, and usually not in the
1476 client. However, you might want to save the roster to a file anyway.
1477 The most common reason for this is probably to copy it to another
1480 To export your roster to a file, type 'M-x jabber-export-roster'. A
1481 buffer will appear in which you can edit the data to be exported.
1482 Changes done in that buffer will not affect your real roster.
1484 To import your roster from a file, type 'M-x jabber-import-roster'.
1485 You will be able to edit the data before importing it. Items not in the
1486 roster will be added; items in the roster will be modified to match
1487 imported data. Subscriptions will be updated.
1489 The format of the roster files is the XML used by roster pushes in
1490 the XMPP protocol, in UTF-8 encoding.
1493 File: jabber.info, Node: XMPP URIs, Next: Customization, Prev: Roster import and export, Up: Top
1498 Many web page authors use links starting with 'xmpp:' for JIDs. Your
1499 web browser could be made to pass such links to jabber.el, so that such
1500 links are actually useful and not just decoration. How to do that
1501 depends on your operating system and web browser.
1503 For any of these methods, you need to make sure that you are running
1504 the Emacs server. *Note Using Emacs as a Server: (emacs)Emacs Server,
1505 though the simplest way to start it is to customize the variable
1511 The jabber.el distribution contains a GConf schema which tries to set up
1512 handling of 'xmpp:' URIs. It is installed by 'make install'. This may
1513 or may not work, depending on your GConf configuration and other
1514 installed applications. To check, try running:
1516 gconftool --get /desktop/gnome/url-handlers/xmpp/command
1518 This should print something like:
1520 /usr/local/libexec/emacs-jabber-uri-handler "%s"
1522 This setting is picked up by most GNOME or GTK based web browsers,
1525 14.2 Mozilla and Unix
1526 =====================
1528 If you use a Mozilla-based web browser on a Unix-like operating system,
1529 and the GConf method above doesn't work, you can set it up manually by
1530 following these steps:
1532 1. Note the path of the 'emacs-jabber-uri-handler' file in the
1533 jabber.el distribution, and make sure it is executable.
1535 2. Set the Mozilla preference 'network.protocol-handler.app.xmpp' to
1536 the path of 'emacs-jabber-uri-handler'. There are two ways to do
1539 * Go to the URL 'about:config', right-click in the list, choose
1540 "New string", and enter 'network.protocol-handler.app.xmpp'
1541 and the path in the following dialogs.
1543 * Open or create the file 'user.js' in your Mozilla profile
1544 directory (in the same directory as 'prefs.js'), and add the
1547 user_pref("network.protocol-handler.app.xmpp",
1548 "/PATH/TO/emacs-jabber-uri-handler");
1550 Restart Mozilla for this change to take effect.
1555 If you know how to pass an XMPP URI from your browser to the function
1556 'jabber-handle-uri', your contribution for this section would be
1560 File: jabber.info, Node: Customization, Next: Hacking and extending, Prev: XMPP URIs, Up: Top
1565 jabber.el is intended to be customizable for many tastes. After all,
1566 this is Emacs. To open a customization buffer for jabber.el, type 'M-x
1571 * Account settings::
1573 * Customizing the roster buffer::
1574 * Customizing the chat buffer::
1575 * Customizing alerts::
1580 File: jabber.info, Node: Account settings, Next: Menu, Up: Customization
1582 15.1 Account settings
1583 =====================
1585 All account settings reside in the variable 'jabber-account-list'.
1586 Usually you only need to set the JID, in the form 'username@server' (or
1587 'username@server/resource' to use a specific resource name). These are
1588 the other account options:
1591 If the account is disabled, 'jabber-connect-all' will not attempt
1592 to connect it. You can still connect it manually with
1596 You can set the password of the account, so you don't have to enter
1597 it when you connect. Note that it will be stored unencrypted in
1598 your customization file.
1601 If the JID of the Jabber server is not also its DNS name, you may
1602 have to enter the real DNS name or IP address of the server here.
1605 This option specifies whether to use an encrypted connection to the
1606 server. Usually you want "STARTTLS" ('starttls'), which means that
1607 encryption is activated if the server supports it. The other
1608 possibilities are "unencrypted" ('network'), which means just that,
1609 and "legacy SSL/TLS" ('ssl'), which means that encryption is
1610 activated on connection.
1613 If the Jabber server uses a nonstandard port, specify it here. The
1614 default is 5222 for STARTTLS and unencrypted connections, and 5223
1615 for legacy SSL connections.
1617 15.1.1 For Google Talk
1618 ----------------------
1620 If you have a very new version of 'dns.el',(1) you can connect to Google
1621 Talk just by specifying your Gmail address as JID. Otherwise, you also
1622 need to set "network server" to 'talk.google.com' and "connection type"
1625 See also *note Gmail notifications::.
1630 Previous versions of jabber.el had the variables 'jabber-username',
1631 'jabber-server', 'jabber-resource' and 'jabber-password'. These are now
1632 obsolete and not used.
1634 ---------- Footnotes ----------
1636 (1) Specifically, you need Emacs 23, or No Gnus 0.3.
1639 File: jabber.info, Node: Menu, Next: Customizing the roster buffer, Prev: Account settings, Up: Customization
1644 There is a Jabber menu on the menu bar with some common commands. By
1645 default, it is displayed only if you are connected, or if you have
1646 configured any accounts. You can set the variable 'jabber-display-menu'
1647 to 't' or 'nil', to have the menu displayed always or never,
1648 respectively. The default behaviour corresponds to the setting 'maybe'.
1650 Earlier, the way to have the menu appear was to call the function
1651 'jabber-menu'. It still works, but is considered obsolete.
1654 File: jabber.info, Node: Customizing the roster buffer, Next: Customizing the chat buffer, Prev: Menu, Up: Customization
1656 15.3 Customizing the roster buffer
1657 ==================================
1659 'jabber-roster-sort-functions' controls how roster items are sorted. By
1660 default, contacts are sorted first by presence, and then alphabetically
1663 'jabber-sort-order' controls how roster items are sorted by presence.
1664 It is a list containing strings corresponding to show status (*note
1665 Presence::) or 'nil', which represents offline.
1667 'jabber-show-resources' controls when your contacts' resources are
1668 shown in the roster buffer. The default is to show resources when a
1669 contact has more than one connected resource.
1671 'jabber-roster-line-format' specifies how the entry for each contact
1672 looks. It is a string where some characters are special if preceded by
1676 Avatar of contact, if any
1678 '*' if the contact is connected, or ' ' if not
1680 Subscription state--see below
1682 Nickname of contact, or JID if no nickname
1684 Bare JID of contact (without resource)
1686 Highest-priority resource of contact
1688 Availability of contact as a string ("Online", "Away" etc)
1690 Status string specified by contact
1692 'jabber-roster-show-title' controls whether to show a "Jabber roster"
1693 string at the top of the roster buffer. You need to run 'M-x
1694 jabber-display-roster' after changing this variable to update the
1697 '%u' is replaced by one of the strings given by
1698 'jabber-roster-subscription-display'.
1700 'jabber-resource-line-format' is nearly identical, except that the
1701 values correspond to the values of the resource in question, and that
1702 the '%p' escape is available, which inserts the priority of the
1705 'jabber-roster-buffer' specifies the name of the roster buffer. If
1706 you change this, the new name will be used the next time the roster is
1709 'jabber-roster-show-bindings' controls whether to show a list of
1710 keybindings at the top of the roster buffer. You need to run 'M-x
1711 jabber-display-roster' after changing this variable to update the
1715 File: jabber.info, Node: Customizing the chat buffer, Next: Customizing alerts, Prev: Customizing the roster buffer, Up: Customization
1717 15.4 Customizing the chat buffer
1718 ================================
1720 You can customize the look of the prompts in the chat buffer. There are
1721 separate settings for local text (i.e. what you write) and foreign text
1722 (i.e. what other people write).
1724 'jabber-chat-text-local' and 'jabber-chat-text-foreign' determine the
1725 faces used for chat messages.
1727 'jabber-chat-prompt-local' and 'jabber-chat-prompt-foreign' determine
1728 the faces used for the prompts. You can also turn on automatic
1729 colorization of local ('jabber-muc-colorize-local') and/or foreign
1730 ('jabber-muc-colorize-foreign') prompts. By default it is off. You can
1731 correct and save for future use auto-generated colors by customizing
1732 'jabber-muc-participant-colors', 'jabber-muc-nick-saturation' and
1733 'jabber-muc-nick-value', if you wish.
1735 'jabber-chat-local-prompt-format' and
1736 'jabber-chat-foreign-prompt-format' determine what text is displayed in
1737 the prompts. They are format strings, with the following special
1741 The time when the message was sent or received
1743 The nickname of the user. For the foreign prompt, this is the name
1744 of the contact in the roster, or the JID if no name set. For the
1745 local prompt, this is the username part of your JID.
1747 The username of the user (i.e. the first part of the JID).
1751 The bare JID of the user
1753 'jabber-chat-time-format' defines how '%t' shows time. Its format is
1754 identical to that passed to 'format-time-string'. *Note Time
1755 Conversion: (elisp)Time Conversion.
1757 'jabber-chat-delayed-time-format' is used instead of
1758 'jabber-chat-time-format' for delayed messages (messages sent while you
1759 were offline, or fetched from history). This way you can have short
1760 timestamps everywhere except where you need long ones. You can always
1761 see the complete timestamp in a tooltip by hovering over the prompt with
1764 By default, timestamps are printed in the chat buffer every hour (at
1765 "rare" times). This can be toggled with 'jabber-print-rare-time'. You
1766 can customize the displayed time by setting 'jabber-rare-time-format'.
1767 Rare timestamps will be printed whenever time formatted by that format
1768 string would change.
1770 You can also customize the header line of chat buffers, by modifying
1771 the variable 'jabber-chat-header-line-format'. The format of that
1772 variable is the same as that of 'mode-line-format' and
1773 'header-line-format'. *Note Mode-Line Format: (elisp)Mode Line Format.
1774 For MUC buffers, 'jabber-muc-header-line-format' is used instead.
1776 The variable 'jabber-chat-fill-long-lines' controls whether long
1777 lines in the chat buffer are wrapped.
1780 File: jabber.info, Node: Customizing alerts, Next: Hooks, Prev: Customizing the chat buffer, Up: Customization
1782 15.5 Customizing alerts
1783 =======================
1785 When an event happens (currently including presence changes, incoming
1786 messages, and completed queries) you will usually want to be notified.
1787 Since tastes in this area vary wildly, these alerts are implemented as
1788 hooks, so you can choose which ones you want, or write your own if none
1791 Actually, if you don't want to write your own, stop reading this
1792 section and just read *note Standard alerts::.
1794 Many kinds of alerts consist in displaying a text message through a
1795 certain mechanism. This text message is provided by a function which
1796 you can rewrite or replace. If this function returns 'nil', no message
1797 is displayed, and non-textual alerts refrain from action.
1799 If you want to write alert hooks that do nothing except displaying
1800 the supplied message in some way, use the macro 'define-jabber-alert'.
1801 For example, if FOO is a function that takes a string as an argument,
1803 (define-jabber-alert foo
1804 "Display a message in a fooish way"
1806 and all details will be taken care of for you.
1808 The hooks take different arguments depending on category. However,
1809 they all have in common that the last argument is the result of the
1810 message function. The message function for each category takes the same
1811 arguments as the corresponding hooks, except for that last argument.
1813 Alert hook contributions are very welcome. You can send them to the
1814 mailing list, or to the Sourceforge patch tracker. *Note Contacts::.
1816 Alert hooks are meant for optional UI things, that are subject to
1817 varying user tastes, and that can be toggled by simply adding or
1818 removing the function to and from the hook. For other purposes, there
1819 are corresponding general hooks, that are defvars instead of defcustoms,
1820 and that are meant to be managed by Lisp code. They have the same name
1821 as the alert hooks minus the '-alert' part, e.g. 'jabber-message-hooks'
1822 vs 'jabber-alert-message-hooks', etc.
1833 File: jabber.info, Node: Standard alerts, Next: Presence alerts, Up: Customizing alerts
1835 15.5.1 Standard alerts
1836 ----------------------
1838 Thirteen alerts are already written for all four alert categories.
1839 These all obey the result from the corresponding message function.
1841 The 'beep' alerts simply sound the terminal bell by calling 'ding'.
1842 They are disabled by default.
1844 The 'echo' alerts display a message in the echo area by calling
1845 'message'. They are enabled by default.
1847 The 'switch' alerts switch to the buffer where the event occurred
1848 (chat buffer for incoming messages, roster buffer for presence changes,
1849 browse buffer for completed queries). They are disabled by default.
1850 Take care when using them, as they may interrupt your editing.
1852 The 'display' alerts display but do not select the buffer in
1853 question, using the function 'display-buffer'. *Note Choosing a Window
1854 for Display: (elisp)Choosing Window, for information about customizing
1855 its behaviour. This is enabled by default for info requests.
1857 The 'wave' alerts play a sound file by calling 'play-sound-file'. No
1858 sound files are provided. To use this, enter the names of the sound
1859 files in 'jabber-alert-message-wave', 'jabber-alert-presence-wave' and
1860 'jabber-alert-info-wave', respectively. You can specify specific sound
1861 files for contacts matching a regexp in the variables
1862 'jabber-alert-message-wave-alist' and
1863 'jabber-alert-presence-wave-alist'.
1865 The 'screen' alerts send a message through the Screen terminal
1866 manager(1). They do no harm if called when you don't use Screen.
1868 The 'tmux' alerts send a message through the tmux terminal
1871 The 'ratpoison' alerts send a message through the Ratpoison window
1872 manager(3). They do no harm if used when you're not running X, but if
1873 you are running X with another window manager, the ratpoison processes
1874 will never exit. Emacs doesn't hold on to them, though.
1876 The 'sawfish' alerts send a message through the Sawfish window
1879 The 'wmii' alerts display a message through the wmii window manager.
1881 The 'awesome' alerts display a message through the awesome window
1882 manager. However, to work it needs naughty (i.e. 'require("naughty")'
1885 The 'xmessage' alerts send a message through the standard 'xmessage'
1886 tool. The variable 'jabber-xmessage-timeout' controls how long the
1889 The 'osd' alerts send a message onto your screen using XOSD.(4)
1891 The 'notifications' alerts send a message using Emacs built-in
1892 package 'notifications.el'. Note that 'notifications.el' first appear
1893 in Emacs 24.1, so they are disabled by default.
1895 The 'libnotify' alerts send a message onto your screen using
1896 'notification-daemon'.
1898 The 'festival' alerts speak the message using the Emacs interface of
1899 the Festival speech synthesis system(5).
1901 The 'autoanswer' alert is kind of special: it will not show you
1902 message/muc alert, but instead will automaticaly answer to sender. See
1903 variable 'jabber-autoanswer-alist' description for details.
1905 Additionally, for one-to-one and MUC messages, there are 'scroll'
1906 alerts (enabled by default), that aim to do the right thing with chat
1907 buffers that are visible but not active. Sometimes you want point to
1908 scroll down, and sometimes not. These functions should do what you
1909 mean; if they don't, it's a bug.
1911 Also, in MUC you can use a family of so-called "personal" alerts.
1912 They are like other MUC alerts, but fire only on incoming messages
1913 addresed directly to you (also known as "private messages"). One
1914 example of such an alert is 'jabber-muc-echo-personal', which shows a
1915 note for an MUC message only if it was addressed to you.
1917 Some of these functions are in the 'jabber-alert.el' file, and the
1918 others are in their own files. You can use them as templates or
1919 inspiration for your own alerts.
1921 ---------- Footnotes ----------
1923 (1) See <http://www.gnu.org/software/screen/>.
1925 (2) See <http://tmux.sourceforge.net/>.
1927 (3) See <http://ratpoison.sourceforge.net/>.
1929 (4) XOSD can be found at <http://www.ignavus.net/software.html>. You
1930 also need 'osd.el' from <http://www.brockman.se/software/osd.el>.
1932 (5) See <http://www.cstr.ed.ac.uk/projects/festival/>.
1935 File: jabber.info, Node: Presence alerts, Next: Message alerts, Prev: Standard alerts, Up: Customizing alerts
1937 15.5.2 Presence alerts
1938 ----------------------
1940 Set 'jabber-alert-presence-message-function' to your desired function.
1941 This function should look like:
1943 (defun FUNCTION (WHO OLDSTATUS NEWSTATUS STATUSTEXT)
1947 WHO is the JID symbol (*note JID symbols::), OLDSTATUS and NEWSTATUS
1948 are the previous and current stati, respectively, and STATUSTEXT is the
1949 status message if provided, otherwise nil.
1951 OLDSTATUS and NEWSTATUS can be one of '""' (i.e. online), '"away"',
1952 '"xa"', '"dnd"', '"chat"', '"error"' and 'nil' (i.e. offline).
1954 NEWSTATUS can also be one of '"subscribe"', '"subscribed"',
1955 '"unsubscribe"' and '"unsubscribed"'.
1957 The default function, 'jabber-presence-default-message', returns
1958 'nil' if OLDSTATUS and NEWSTATUS are the same, and in other cases
1959 constructs a message from the given data.
1961 Another function, 'jabber-presence-only-chat-open-message', behave
1962 just like 'jabber-presence-default-message', but only if conversation
1963 buffer for according JID is already open. Use it to show presence
1964 notifications only for "interesting" contacts.
1966 All presence alert hooks take the same arguments plus the additional
1967 PROPOSED-ALERT, which is the result of the specified message function.
1968 This last argument is usually the only one they use.
1971 File: jabber.info, Node: Message alerts, Next: MUC alerts, Prev: Presence alerts, Up: Customizing alerts
1973 15.5.3 Message alerts
1974 ---------------------
1976 Set 'jabber-alert-message-function' to your desired function.(1) This
1977 function should look like:
1979 (defun FUNCTION (FROM BUFFER TEXT)
1983 FROM is the JID symbol (*note JID symbols::), BUFFER is the buffer
1984 where the message is displayed, and TEXT is the text of the message.
1986 The default function, 'jabber-message-default-message', returns
1987 "Message from PERSON", where PERSON is the name of the person if
1988 specified in the roster, otherwise the JID.
1990 All message alert hooks take the same arguments plus the additional
1991 PROPOSED-ALERT, which is the result of the specified message function.
1993 If you don't want message alerts when the chat buffer in question is
1994 already the current buffer, set 'jabber-message-alert-same-buffer' to
1995 nil. This affects the behaviour of the default message function, so
1996 you'll have to reimplement this functionality if you write your own
1999 ---------- Footnotes ----------
2001 (1) Logically it should be 'jabber-alert-message-message-function',
2002 but that would be really ugly.
2005 File: jabber.info, Node: MUC alerts, Next: Info alerts, Prev: Message alerts, Up: Customizing alerts
2010 Set 'jabber-alert-muc-function' to your desired function. This function
2013 (defun FUNCTION (NICK GROUP BUFFER TEXT)
2017 NICK is the nickname, GROUP is the JID of the group, BUFFER is the
2018 buffer where the message is displayed, and TEXT is the text of the
2021 The default function, 'jabber-muc-default-message', returns "Message
2022 from NICK in GROUP" or "Message in GROUP", the latter for messages from
2025 All MUC alert hooks take the same arguments plus the additional
2026 PROPOSED-ALERT, which is the result of the specified message function.
2028 By default, no alert is made for messages from yourself. To change
2029 that, customize the variable 'jabber-muc-alert-self'.
2032 File: jabber.info, Node: Info alerts, Prev: MUC alerts, Up: Customizing alerts
2037 Info alerts are sadly underdeveloped. The message function,
2038 'jabber-alert-info-message-function', takes two arguments, INFOTYPE and
2039 BUFFER. BUFFER is the buffer where something happened, and INFOTYPE is
2040 either ''roster' for roster updates, or ''browse' for anything that uses
2041 the browse buffer (basically anything except chatting).
2043 The info alert hooks take an extra argument, as could be expected.
2046 File: jabber.info, Node: Hooks, Next: Debug options, Prev: Customizing alerts, Up: Customization
2051 jabber.el provides various hooks that you can use for whatever purpose.
2053 'jabber-post-connect-hooks'
2054 This hook is called after successful connection and authentication.
2055 By default it contains 'jabber-send-current-presence' (*note
2056 Presence::). The hook functions get the connection object as
2059 'jabber-lost-connection-hooks'
2060 This hook is called when you have been disconnected for unknown
2061 reasons. Usually this isn't noticed for quite a long time.
2063 The hook is called with one argument: the connection object.
2065 'jabber-pre-disconnect-hook'
2066 This hook is called just before voluntary disconnection, i.e. in
2067 'jabber-disconnect', the command to disconnect all accounts. There
2068 is currently no hook for disconnection of a single account.
2070 'jabber-post-disconnect-hook'
2071 This hook is called after disconnection of any kind, possibly just
2072 after 'jabber-lost-connection-hook'.
2074 'jabber-chat-mode-hook'
2075 This hook is called when a new chat buffer is created.
2077 'jabber-browse-mode-hook'
2078 This hook is called when a new browse buffer is created.
2080 'jabber-roster-mode-hook'
2081 This hook is called when the roster buffer is created.
2084 File: jabber.info, Node: Debug options, Prev: Hooks, Up: Customization
2089 These settings provide a lot of information which is usually not very
2090 interesting, but can be useful for debugging various things.
2092 'jabber-debug-log-xml' activates XML console. All XML stanzas sent
2093 and received are logged in the buffer '*-jabber-console-JID-*' (and to
2094 specified file if value is string). Also this buffer can be used to
2095 send XML stanzas manually.
2097 Format for console buffer name. %s mean connection jid. Default
2098 value is '*-jabber-console-%s-*'.
2100 Maximum number of lines in console buffer. Use this option to
2101 prevent over bloating size of buffer. Set value to 0 if you want to
2102 keep all stanzas in buffer, but it's not recommended and may be unsafe.
2104 Usually, the process buffers for Jabber connections are killed when
2105 the connection is closed, as they would otherwise just fill up memory.
2106 However, they might contain information about why the connection was
2107 lost. To keep process buffers, set 'jabber-debug-keep-process-buffers'
2111 File: jabber.info, Node: Hacking and extending, Next: Protocol support, Prev: Customization, Up: Top
2113 16 Hacking and extending
2114 ************************
2116 This part of the manual is an attempt to explain parts of the source
2117 code. It is not meant to discourage you from reading the code yourself
2118 and trying to figure it out, but as a guide on where to look. Knowledge
2119 of Jabber protocols is assumed.
2123 * Connection object::
2124 * XML representation::
2126 * Listening for new requests::
2127 * Sending new requests::
2128 * Extending service discovery::
2133 File: jabber.info, Node: Connection object, Next: XML representation, Up: Hacking and extending
2135 16.1 Connection object
2136 ======================
2138 Each Jabber connection is represented by a "connection object". This
2139 object has the form of a finite state machine, and is realized by the
2142 The various states of this object are defined in 'jabber-core.el'.
2143 They describe the way of the connection through the establishing of a
2144 network connection and authentication, and finally comes to the
2145 ':session-established' state where ordinary traffic takes place.
2147 These details are normally opaque to an extension author. As will be
2148 noted, many functions expect to receive a connection object, and
2149 functions at extension points generally receive such an object in order
2150 to pass it on. The following functions simply query the internal state
2153 -- Function: jabber-connection-jid connection
2154 The 'jabber-connection-jid' function returns the full JID of
2155 CONNECTION, i.e. a string of the form
2156 '"username@server/resource"'.
2158 -- Function: jabber-connection-bare-jid connection
2159 The 'jabber-connection-bare-jid' function returns the bare JID of
2160 CONNECTION, i.e. a string of the form '"username@server"'.
2162 ---------- Footnotes ----------
2164 (1) So far, this library is only distributed with jabber.el. The
2165 author hopes that it could be useful for other projects, too.
2168 File: jabber.info, Node: XML representation, Next: JID symbols, Prev: Connection object, Up: Hacking and extending
2170 16.2 XML representation
2171 =======================
2173 The XML representation is the one generated by 'xml.el' in Emacs, namely
2174 the following. Each tag is a list. The first element of the list is a
2175 symbol, the name of which is the name of the tag. The second element is
2176 an alist of attributes, where the keys are the attribute names in symbol
2177 form, and the values are strings. The remaining elements are the tags
2178 and data contained within the tag.
2185 (foo ((bar . "baz")) (frobozz nil "") "Fnord
2188 Note the empty string as the third element of the 'frobozz' list. It
2189 is not present in newer (post-21.3) versions of 'xml.el', but it's
2190 probably best to assume it might be there.
2192 -- Function: jabber-sexp2xml xml-sexp
2193 This function takes a tag in list representation, and returns its
2194 XML representation as a string. You will normally not need to use
2195 this function directly, but it can be useful to see how your sexps
2196 will look when sent to the outer, non-Lisp, world.
2198 -- Function: jabber-send-sexp connection sexp
2199 This function sends SEXP, an XMPP stanza in list representation,
2200 and sends it over CONNECTION.
2202 You will normally use the functions 'jabber-send-presence',
2203 'jabber-send-message' and 'jabber-send-iq' instead of this
2207 File: jabber.info, Node: JID symbols, Next: Listening for new requests, Prev: XML representation, Up: Hacking and extending
2212 JIDs are sometimes represented as symbols. Its name is the JID, and it
2213 is interned in 'jabber-jid-obarray'. A roster entry can have the
2214 following properties:
2217 The XML tag received from the server on roster update
2220 The name of the roster item (just like the XML attribute)
2223 The subscription state; a string, one of '"none"', '"from"', '"to"'
2227 The ask state; either 'nil' or '"subscribe"'
2230 A list of strings (possibly empty) containing all the groups the
2234 Boolean, true if any resource is connected
2237 Presence show value for highest-priority connected resource; a
2238 string, one of '""' (i.e. online), '"away"', '"xa"', '"dnd"',
2239 '"chat"', '"error"' and 'nil' (i.e. offline)
2242 Presence status message for highest-priority connected resource
2245 Alist. Keys are strings (resource names), values are plists with
2246 properties 'connected', 'show', 'status' and 'priority'.
2248 Incoming presence information is inserted in 'resources', and the
2249 information from the resource with the highest priority is inserted in
2250 'show' and 'status' by the function 'jabber-prioritize-resources'.
2253 File: jabber.info, Node: Listening for new requests, Next: Sending new requests, Prev: JID symbols, Up: Hacking and extending
2255 16.4 Listening for new requests
2256 ===============================
2258 To listen for new IQ requests, add the appropriate entry in
2259 'jabber-iq-get-xmlns-alist' or 'jabber-iq-set-xmlns-alist'. The key is
2260 the namespace of the request, and the value is a function that takes two
2261 arguments, the connection object, and the entire IQ stanza in list
2262 format. 'jabber-process-iq' reads these alists to determine which
2263 function to call on incoming packets.
2265 For example, the Ad-Hoc Commands module contains the following:
2267 (add-to-list 'jabber-iq-set-xmlns-alist
2268 (cons "http://jabber.org/protocol/commands"
2269 'jabber-ahc-process))
2271 To send a response to an IQ request, use '(jabber-send-iq CONNECTION
2272 SENDER "result" QUERY nil nil nil nil ID)', where QUERY is the query in
2273 list format. 'jabber-send-iq' will encapsulate the query in an IQ
2274 packet with the specified id.
2276 To return an error to the Jabber entity that sent the query, use
2277 'jabber-signal-error'. The signal is caught by 'jabber-process-iq',
2278 which takes care of sending the error. You can also use
2279 'jabber-send-iq-error'.
2282 File: jabber.info, Node: Sending new requests, Next: Extending service discovery, Prev: Listening for new requests, Up: Hacking and extending
2284 16.5 Sending new requests
2285 =========================
2287 To send an IQ request, use 'jabber-send-iq'. It will generate an id,
2288 and create a mapping for it for use when the response comes. The syntax
2291 (jabber-send-iq CONNECTION TO TYPE QUERY
2292 SUCCESS-CALLBACK SUCCESS-CLOSURE
2293 FAILURE-CALLBACK FAILURE-CLOSURE)
2295 SUCCESS-CALLBACK will be called if the response is of type 'result',
2296 and FAILURE-CALLBACK will be called if the response is of type 'error'.
2297 Both callbacks take three arguments, the connection object, the IQ
2298 stanza of the response, and the corresponding closure item earlier
2299 passed to 'jabber-send-iq'.
2301 Two standard callbacks are provided. 'jabber-report-success' takes a
2302 string as closure item, and reports success or failure in the echo area
2303 by appending either 'succeeded' or 'failed' to the string.
2304 'jabber-process-data' prepares a browse buffer. If its closure argument
2305 is a function, it calls that function with point in this browse buffer.
2306 If it's a string, it prints that string along with the error message in
2307 the IQ response. If it's anything else (e.g. 'nil'), it just dumps the
2308 XML in the browse buffer.
2310 Examples follow. This is the hypothetical Jabber protocol "frob",
2311 for which only success report is needed:
2312 (jabber-send-iq connection
2313 "someone@somewhere.org" "set"
2314 '(query ((xmlns . "frob")))
2315 'jabber-report-success "Frobbing"
2316 'jabber-report-success "Frobbing")
2317 This will print "Frobbing succeeded" or "Frobbing failed: REASON",
2318 respectively, in the echo area.
2320 The protocol "investigate" needs to parse results and show them in a
2322 (jabber-send-iq connection
2323 "someone@somewhere.org" "get"
2324 '(query ((xmlns . "investigate")))
2325 'jabber-process-data 'jabber-process-investigate
2326 'jabber-process-data "Investigation failed")
2327 Of course, the previous example could have used
2328 'jabber-report-success' for the error message. It's a matter of UI
2332 File: jabber.info, Node: Extending service discovery, Next: Chat printers, Prev: Sending new requests, Up: Hacking and extending
2334 16.6 Service discovery
2335 ======================
2337 Service discovery (XEP-0030) is a Jabber protocol for communicating
2338 features supported by a certain entity, and items affiliated with an
2339 entity. jabber.el has APIs for both providing and requesting such
2348 File: jabber.info, Node: Providing info, Next: Requesting info, Up: Extending service discovery
2350 16.6.1 Providing info
2351 ---------------------
2353 Your new IQ request handlers will likely want to advertise their
2354 existence through service discovery.
2356 To have an additional feature reported in response to disco info
2357 requests, add a string to 'jabber-advertised-features'.
2359 By default, the service discovery functions reject all requests
2360 containing a node identifier with an "Item not found" error. To make
2361 them respond, add the appropriate entries to 'jabber-disco-items-nodes'
2362 and 'jabber-disco-info-nodes'. Both variables work in the same way.
2363 They are alists, where the keys are the node names, and the values are
2366 The first item is the data to return -- either a list, or a function
2367 taking the connection object and the entire IQ stanza and returning a
2368 list; in either case this list contains the XML nodes to include in the
2369 '<query/>' node in the response.
2371 The second item is the access control function. An access control
2372 function receives the connection object and a JID as arguments, and
2373 returns non-nil if access is to be granted. If nil is specified instead
2374 of a function, access is always granted. One such function is provided,
2375 'jabber-my-jid-p', which grants access for JIDs where the username and
2376 server (not necessarily resource) are equal to those of the user, or one
2377 of the user's configured accounts.
2380 File: jabber.info, Node: Requesting info, Prev: Providing info, Up: Extending service discovery
2382 16.6.2 Requesting info
2383 ----------------------
2385 jabber.el has a facility for requesting disco items and info. All
2386 positive responses are cached.
2388 To request disco items or info from an entity, user one of these
2391 -- Function: jabber-disco-get-info jc jid node callback closure-data
2393 Get disco information for JID and NODE. A request is sent
2394 asynchronously on the connection JC. When the response arrives,
2395 CALLBACK is called with three arguments: JC, CLOSURE-DATA, and the
2396 result. The result may be retrieved from the cache, unless FORCE
2399 If the request was successful, or retrieved from cache, it looks
2400 like '(IDENTITIES FEATURES)', where IDENTITIES and FEATURES are
2401 lists. Each identity is '["NAME" "CATEGORY" "TYPE"]', and each
2402 feature is a string denoting the namespace of the feature.
2404 If the request failed, the result is an '<error/>' node.
2406 -- Function: jabber-disco-get-items jc jid node callback closure-data
2408 Get disco information for JID and NODE. A request is sent
2409 asynchronously on the connection JC. When the response arrives,
2410 CALLBACK is called with three arguments: JC, CLOSURE-DATA, and the
2411 result. The result may be retrieved from the cache, unless FORCE
2414 If the request was successful, or retrieved from cache, the result
2415 is a list of items, where each item is '["NAME" "JID" "NODE"]'.
2416 The values are either strings or nil.
2418 If the request failed, the result is an '<error/>' node.
2420 If you only want to see what is in the cache, use one of the
2421 following functions. They don't use a callback, but return the result
2424 -- Function: jabber-disco-get-info-immediately jid node
2425 Return cached disco information for JID and NODE, or nil if the
2426 cache doesn't contain this information. The result is the same as
2427 for 'jabber-disco-get-info'.
2429 -- Function: jabber-disco-get-items-immediately jid node
2430 Return cached disco items for JID and NODE, or nil if the cache
2431 doesn't contain this information. The result is the same as for
2432 'jabber-disco-get-items'.
2434 In the future, this facility will be expanded to provide information
2435 acquired through XEP-0115, Entity capabilities, which is a protocol for
2436 sending disco information in '<presence/>' stanzas.
2439 File: jabber.info, Node: Chat printers, Next: Stanza chains, Prev: Extending service discovery, Up: Hacking and extending
2444 Chat printers are functions that print a certain aspect of an incoming
2445 message in a chat buffer. Included are functions for printing subjects
2446 ('jabber-chat-print-subject'), bodies ('jabber-chat-print-body', and
2447 'jabber:x:oob'-style URLs ('jabber-chat-print-url'). The functions in
2448 'jabber-chat-printers' are called in order, with the entire '<message/>'
2449 stanza as argument. As described in the docstring of
2450 'jabber-chat-printers', these functions are run in one of two modes:
2451 'printp', in which they are supposed to return true if they would print
2452 anything, and 'insert', in which they are supposed to actually print
2453 something, if appropriate, using the function 'insert'.
2455 For MUC, the functions in 'jabber-muc-printers' are prepended to
2456 those in 'jabber-chat-printers'.
2458 Body printers are a subgroup of chat printers. They are exclusive;
2459 only one of them applies to any given message. The idea is that
2460 "higher-quality" parts of the message override pieces included for
2461 backwards compatibility. Included are 'jabber-muc-print-invite' and
2462 'jabber-chat-normal-body'; functions for XHTML-IM and PGP encrypted
2463 messages may be written in the future. The functions in
2464 'jabber-body-printers' are called in order until one of them returns
2468 File: jabber.info, Node: Stanza chains, Prev: Chat printers, Up: Hacking and extending
2473 If you really need to get under the skin of jabber.el, you can add
2474 functions to the lists 'jabber-message-chain', 'jabber-iq-chain' and
2475 'jabber-presence-chain'. The functions in these lists will be called in
2476 order when an XML stanza of the corresponding type arrives, with the
2477 connection object and the entire XML stanza passed as arguments.
2478 Earlier functions can modify the stanza to change the behaviour of
2479 downstream functions, but remember: with great power comes great
2483 File: jabber.info, Node: Protocol support, Next: Concept index, Prev: Hacking and extending, Up: Top
2485 Appendix A Protocol support
2486 ***************************
2488 These are the protocols currently supported (in full or partially) by
2493 * RFC 3920:: XMPP-CORE
2494 * RFC 3921:: XMPP-IM
2495 * XEP-0004:: Data Forms
2496 * XEP-0012:: Last Activity
2497 * XEP-0020:: Feature Negotiation
2498 * XEP-0022:: Message Events
2499 * XEP-0030:: Service Discovery
2500 * XEP-0045:: Multi-User Chat
2501 * XEP-0049:: Private XML Storage
2502 * XEP-0050:: Ad-Hoc Commands
2503 * XEP-0054:: vcard-temp
2504 * XEP-0055:: Jabber Search
2505 * XEP-0065:: SOCKS5 Bytestreams
2506 * XEP-0066:: Out of Band Data
2507 * XEP-0068:: Field Standardization for Data Forms
2508 * XEP-0077:: In-Band Registration
2509 * XEP-0078:: Non-SASL Authentication
2510 * XEP-0082:: Jabber Date and Time Profiles
2511 * XEP-0085:: Chat State Notifications
2512 * XEP-0086:: Error Condition Mappings
2513 * XEP-0090:: Entity Time
2514 * XEP-0091:: Delayed Delivery
2515 * XEP-0092:: Software Version
2516 * XEP-0095:: Stream Initiation
2517 * XEP-0096:: File Transfer
2518 * XEP-0146:: Remote Controlling Clients
2519 * XEP-0153:: vCard-Based Avatars
2520 * XEP-0199:: XMPP Ping
2521 * XEP-0245:: The /me Command
2524 File: jabber.info, Node: RFC 3920, Next: RFC 3921, Up: Protocol support
2526 A.1 RFC 3920 (XMPP-CORE)
2527 ========================
2529 Most of RFC 3920 is supported, with the following exceptions.
2531 SASL is supported only when an external SASL library from FLIM or
2532 Gnus is present. As SASL is an essential part to XMPP, jabber.el will
2533 send pre-XMPP stream headers if it is not available.
2535 None of the stringprep profiles are implemented. jabber.el changes
2536 JIDs to lowercase internally; that's all.
2538 jabber.el doesn't interpret namespace prefixes.
2540 The 'xml:lang' attribute is neither interpreted nor generated.
2542 SRV records are used if a modern version of 'dns.el' is installed.
2545 File: jabber.info, Node: RFC 3921, Next: XEP-0004, Prev: RFC 3920, Up: Protocol support
2547 A.2 RFC 3921 (XMPP-IM)
2548 ======================
2550 Most of RFC 3921 is supported, with the following exceptions.
2552 Messages of type "headline" are not treated in any special way.
2554 The '<thread/>' element is not used or generated.
2556 Sending "directed presence" is supported; however, presence stanzas
2557 received from contacts not in roster are ignored.
2559 Privacy lists are not supported at all.
2561 jabber.el doesn't support XMPP-E2E or "im:" CPIM URIs.
2564 File: jabber.info, Node: XEP-0004, Next: XEP-0012, Prev: RFC 3921, Up: Protocol support
2566 A.3 XEP-0004 (Data Forms)
2567 =========================
2569 XEP-0004 support is good enough for many purposes. Limitations are the
2572 Forms in incoming messages are not interpreted. See each specific
2573 protocol for whether forms are accepted in that context.
2575 "Cancel" messages are probably not consistently generated when they
2576 should be. This is partly a paradigm clash, as jabber.el doesn't use
2577 modal dialog boxes but buffers which can easily be buried.
2579 '<required/>' elements are not enforced.
2581 The field types "jid-single", "jid-multi" and "list-multi" are not
2582 implemented, due to programmer laziness. Let us know if you need them.
2585 File: jabber.info, Node: XEP-0012, Next: XEP-0020, Prev: XEP-0004, Up: Protocol support
2587 A.4 XEP-0012 (Last Activity)
2588 ============================
2590 jabber.el can generate all three query types described in the protocol.
2591 However, it does not answer to such requests.
2594 File: jabber.info, Node: XEP-0020, Next: XEP-0022, Prev: XEP-0012, Up: Protocol support
2596 A.5 XEP-0020 (Feature Negotiation)
2597 ==================================
2599 There are no known limitations or bugs in XEP-0020 support.
2602 File: jabber.info, Node: XEP-0022, Next: XEP-0030, Prev: XEP-0020, Up: Protocol support
2604 A.6 XEP-0022 (Message Events)
2605 =============================
2607 jabber.el understands all four specified kinds of message events
2608 (offline, delivered, displayed, and composing) and by default requests
2609 all of them. It also reports those three events that make sense for
2613 File: jabber.info, Node: XEP-0030, Next: XEP-0045, Prev: XEP-0022, Up: Protocol support
2615 A.7 XEP-0030 (Service Discovery)
2616 ================================
2618 Service discovery is supported, both as client and server. When used in
2619 the code, service discovery results are cached indefinitely.
2622 File: jabber.info, Node: XEP-0045, Next: XEP-0049, Prev: XEP-0030, Up: Protocol support
2624 A.8 XEP-0045 (Multi-User Chat)
2625 ==============================
2627 jabber.el supports parts of XEP-0045. Entering, leaving and chatting
2628 work. So do invitations and private messages. Room configuration is
2629 supported. Changing roles of participants (basic moderation) is
2630 implemented, as is changing affiliations, but requesting affiliation
2631 lists is not yet supported.
2634 File: jabber.info, Node: XEP-0049, Next: XEP-0050, Prev: XEP-0045, Up: Protocol support
2636 A.9 XEP-0049 (Private XML Storage)
2637 ==================================
2639 jabber.el contains an implementation of XEP-0049; It is used for
2640 bookmarks and roster's groups roll state saving.
2643 File: jabber.info, Node: XEP-0050, Next: XEP-0054, Prev: XEP-0049, Up: Protocol support
2645 A.10 XEP-0050 (Ad-Hoc Commands)
2646 ===============================
2648 jabber.el is probably the first implementation of XEP-0050 (see post on
2649 jdev from 2004-03-10
2650 (http://article.gmane.org/gmane.network.jabber.devel/21413)). Both the
2651 client and server parts are supported.
2654 File: jabber.info, Node: XEP-0054, Next: XEP-0055, Prev: XEP-0050, Up: Protocol support
2656 A.11 XEP-0054 (vcard-temp)
2657 ==========================
2659 Both displaying other users' vCards and editing your own vCard are
2660 supported. The implementation tries to follow the schema in the XEP
2664 File: jabber.info, Node: XEP-0055, Next: XEP-0065, Prev: XEP-0054, Up: Protocol support
2666 A.12 XEP-0055 (Jabber Search)
2667 =============================
2669 XEP-0055 is supported, both with traditional fields and with Data Forms
2670 (*note XEP-0004::). As the traditional fields specified by the XEP is a
2671 subset of those allowed in XEP-0077, handling of those two form types
2672 are merged. *Note XEP-0077::.
2675 File: jabber.info, Node: XEP-0065, Next: XEP-0066, Prev: XEP-0055, Up: Protocol support
2677 A.13 XEP-0065 (SOCKS5 Bytestreams)
2678 ==================================
2680 XEP-0065 is supported. Currently jabber.el cannot act as a server, not
2681 even on on Emacsen that support server sockets (GNU Emacs 22 and up).
2682 Therefore it relies on proxies. Proxies have to be entered and queried
2685 Psi's "fast mode" (<http://delta.affinix.com/specs/stream.html>),
2686 which gives greater flexibility with regards to NAT, is not implemented.
2689 File: jabber.info, Node: XEP-0066, Next: XEP-0068, Prev: XEP-0065, Up: Protocol support
2691 A.14 XEP-0066 (Out of Band Data)
2692 ================================
2694 jabber.el will display URLs sent in message stanzas qualified by the
2695 'jabber:x:oob' namespace, as described in this XEP. Sending such URLs or
2696 doing anything with iq stanzas (using the 'jabber:iq:oob' namespace) is
2700 File: jabber.info, Node: XEP-0068, Next: XEP-0077, Prev: XEP-0066, Up: Protocol support
2702 A.15 XEP-0068 (Field Standardization for Data Forms)
2703 ====================================================
2705 XEP-0068 is only used in the context of creating a new Jabber account,
2706 to prefill the username field of the registration form.
2709 File: jabber.info, Node: XEP-0077, Next: XEP-0078, Prev: XEP-0068, Up: Protocol support
2711 A.16 XEP-0077 (In-Band Registration)
2712 ====================================
2714 In-band registration is supported for all purposes. That means
2715 registering a new Jabber account, changing Jabber password, removing a
2716 Jabber account, registering with a service, and cancelling registration
2717 to a service. Data forms are supported as well. URL redirections are
2720 jabber.el will not prevent or alert a user trying to change a
2721 password over an unencrypted connection.
2724 File: jabber.info, Node: XEP-0078, Next: XEP-0082, Prev: XEP-0077, Up: Protocol support
2726 A.17 XEP-0078 (Non-SASL Authentication)
2727 =======================================
2729 Non-SASL authentication is supported, both plaintext and digest. Digest
2730 is preferred, and a warning is displayed to the user if only plaintext
2734 File: jabber.info, Node: XEP-0082, Next: XEP-0085, Prev: XEP-0078, Up: Protocol support
2736 A.18 XEP-0082 (Jabber Date and Time Profiles)
2737 =============================================
2739 The DateTime profile of XEP-0082 is supported. Currently this is only
2740 used for file transfer.
2743 File: jabber.info, Node: XEP-0085, Next: XEP-0086, Prev: XEP-0082, Up: Protocol support
2745 A.19 XEP-0085 (Chat State Notifications)
2746 ========================================
2748 XEP-0085 is partially supported. Currently only active/composing
2749 notifications are _sent_ though all five notifications are handled on
2753 File: jabber.info, Node: XEP-0086, Next: XEP-0090, Prev: XEP-0085, Up: Protocol support
2755 A.20 XEP-0086 (Error Condition Mappings)
2756 ========================================
2758 Legacy errors are interpreted, but never generated. XMPP style error
2759 messages take precedence when errors are reported to the user.
2762 File: jabber.info, Node: XEP-0090, Next: XEP-0091, Prev: XEP-0086, Up: Protocol support
2764 A.21 XEP-0090 (Entity Time)
2765 ===========================
2767 jabber.el can query other entities for their time, and return the
2768 current time to those who ask.
2771 File: jabber.info, Node: XEP-0091, Next: XEP-0092, Prev: XEP-0090, Up: Protocol support
2773 A.22 XEP-0091 (Delayed Delivery)
2774 ================================
2776 The time specified on delayed incoming messages is interpreted, and
2777 displayed in chat buffers instead of the current time.
2780 File: jabber.info, Node: XEP-0092, Next: XEP-0095, Prev: XEP-0091, Up: Protocol support
2782 A.23 XEP-0092 (Software Version)
2783 ================================
2785 The user can request the version of any entity. jabber.el answers
2786 version requests to anyone, giving "jabber.el" as name, and the Emacs
2790 File: jabber.info, Node: XEP-0095, Next: XEP-0096, Prev: XEP-0092, Up: Protocol support
2792 A.24 XEP-0095 (Stream Initiation)
2793 =================================
2795 XEP-0095 is supported, both incoming and outgoing, except that jabber.el
2796 doesn't check service discovery results before sending a stream
2800 File: jabber.info, Node: XEP-0096, Next: XEP-0146, Prev: XEP-0095, Up: Protocol support
2802 A.25 XEP-0096 (File Transfer)
2803 =============================
2805 Both sending and receiving files is supported. If a suitable program is
2806 found, MD5 hashes of outgoing files are calculated and sent. However,
2807 hashes of received files are not checked. Ranged transfers are not
2808 supported. In-band bytestreams are not yet supported, even though
2809 XEP-0096 requires them.
2812 File: jabber.info, Node: XEP-0146, Next: XEP-0153, Prev: XEP-0096, Up: Protocol support
2814 A.26 XEP-0146 (Remote Controlling Clients)
2815 ==========================================
2817 The "set-status" command in XEP-0146 is supported.
2820 File: jabber.info, Node: XEP-0153, Next: XEP-0199, Prev: XEP-0146, Up: Protocol support
2822 A.27 XEP-0153 (vCard-Based Avatars)
2823 ===================================
2825 vCard-based avatars are supported, both publishing and displaying. The
2826 pixel size limits on avatars are not enforced.
2829 File: jabber.info, Node: XEP-0199, Next: XEP-0245, Prev: XEP-0153, Up: Protocol support
2831 A.28 XEP-0199 (XMPP Ping)
2832 =========================
2834 XEP-0199 is fully supported.
2837 File: jabber.info, Node: XEP-0245, Prev: XEP-0199, Up: Protocol support
2839 A.29 XEP-0245 (/me Command)
2840 ===========================
2842 XEP-0245 is partially supported (except XHTML-IM).
2845 File: jabber.info, Node: Concept index, Next: Function index, Prev: Protocol support, Up: Top