doc updates

This commit is contained in:
nik gaffney 2009-04-16 17:33:06 +02:00
parent 5577f23694
commit f4074e0fa0
2 changed files with 41 additions and 23 deletions

View file

@ -7,7 +7,7 @@ A basic module for IM using the Jabber/XMPP protocol with PLT Scheme.
Should eventually implement XMPP-Core and XMPP-IM to conform with RFCs Should eventually implement XMPP-Core and XMPP-IM to conform with RFCs
3920 and 3921. Progress toward supporting the full protocol is 3920 and 3921. Progress toward supporting the full protocol is
currently documented in the file 'xmpp.ss' currently documented in the file `xmpp.ss`
## Installation ## Installation
@ -18,24 +18,24 @@ currently documented in the file 'xmpp.ss'
It is necessary to establish a session with a Jabber server before It is necessary to establish a session with a Jabber server before
sending any messages or presence updates. This can be done manually, sending any messages or presence updates. This can be done manually,
or with the help of with-xmpp-session. or with the help of `with-xmpp-session`.
## Sending ## Sending
Once a session is established, the 'send' function can be used to send Once a session is established, the `send` function can be used to send
messages, presnece updates or queries. messages, presence updates or queries.
(with-xmpp-session jid pass (with-xmpp-session jid pass
(send (message user@host "some random message"))) (send (message "user@host" "some random message")))
Where 'jid' is the senders jid and 'pass' is the password Where `jid` is the senders jid and `pass` is the password
## Response Handlers ## Response Handlers
A handler can be registered to repsond to 'message 'presence 'iq or A handler can be registered to respond to `'message` `'presence` `'iq` or
'other stanzas. Note that an 'iq handler will revive any error `'other` stanzas. Note that an `'iq` handler will receive any error
messages from the server messages from the server
(set-xmpp-handler 'message print-message) (set-xmpp-handler 'message print-message)
@ -61,7 +61,7 @@ messages from the server
(loop)))))) (loop))))))
## possiby interesting extensions to implement. ## possibly interesting extensions to implement.
see http://xmpp.org/extensions/ see http://xmpp.org/extensions/

View file

@ -9,23 +9,38 @@ A module for using the Jabber/XMPP protocol.
@section{Protocol Support} @section{Protocol Support}
It should eventually implement XMPP-Core and XMPP-IM to conform with A minimal subset of the XMPP protocols are supported, but not much
RFCs 3920 and 3921. Progress toward supporting the full protocol is beyond sending and receiving messages and presence updates. This
currently documented in the file 'xmpp.ss' module should eventually implement XMPP-Core and XMPP-IM to conform
with RFCs 3920 and 3921. Currently, the default connection uses 'old
style' SSL, which is deprecated and may cause problems with some
servers. Progress toward supporting the full protocol is documented in
the file 'xmpp.ss'
@section{Installation}
@schemeblock[(require (planet zzkt/xmpp:1:0/xmpp))]
@section{Session} @section{Session}
@schemeblock[ It is necessary to establish a session with a Jabber server before
(with-xmpp-session jid pass body) sending any messages or presence updates. This can be done manually,
] or with the help of with-xmpp-session.
@section{Mesaging} @defform[(with-xmpp-seesion [jid jid?] [password string?] body)]{
Establishes an XMPP session using the id @scheme[jid] and password
@scheme[pass] and evaluates the forms in @scheme[body] in the
session's scope.}
@section{Sending}
Once a session is established, the 'send' function can be used to send
messages, presence updates or queries.
@section{Messages}
To send a message containing @scheme[text] to a user with the
@scheme[jid] of @scheme[to].
@schemeblock[ @schemeblock[
(with-xmpp-session jid pass (with-xmpp-session jid pass
(send (message to text))) (send (message to text)))
@ -33,12 +48,15 @@ currently documented in the file 'xmpp.ss'
@section{Presence} @section{Presence}
@schemeblock[ @schemeblock[
(with-xmpp-session jid pass (with-xmpp-session jid pass
(send (presence))) (send (presence)))
] ]
@section{Registration} @schemeblock[
(with-xmpp-session jid pass
(send (presence #:status "Available")))
]
@section{Response Handling} @section{Response Handling}