Next: , Previous: Hacking and extending, Up: Hacking and extending


16.1 Connection object

Each Jabber connection is represented by a “connection object”. This object has the form of a finite state machine, and is realized by the library fsm.1

The various states of this object are defined in jabber-core.el. They describe the way of the connection through the establishing of a network connection and authentication, and finally comes to the :session-established state where ordinary traffic takes place.

These details are normally opaque to an extension author. As will be noted, many functions expect to receive a connection object, and functions at extension points generally receive such an object in order to pass it on. The following functions simply query the internal state of the connection:

— Function: jabber-connection-jid connection

The jabber-connection-jid function returns the full JID of connection, i.e. a string of the form "username@server/resource".

— Function: jabber-connection-bare-jid connection

The jabber-connection-bare-jid function returns the bare JID of connection, i.e. a string of the form "username@server".


Footnotes

[1] So far, this library is only distributed with jabber.el. The author hopes that it could be useful for other projects, too.