diff --git a/README.md b/README.md index c6fdfff..d794aa5 100644 --- a/README.md +++ b/README.md @@ -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 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 @@ -18,24 +18,24 @@ currently documented in the file 'xmpp.ss' It is necessary to establish a session with a Jabber server before 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 -Once a session is established, the 'send' function can be used to send -messages, presnece updates or queries. +Once a session is established, the `send` function can be used to send +messages, presence updates or queries. (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 -A handler can be registered to repsond to 'message 'presence 'iq or -'other stanzas. Note that an 'iq handler will revive any error +A handler can be registered to respond to `'message` `'presence` `'iq` or +`'other` stanzas. Note that an `'iq` handler will receive any error messages from the server (set-xmpp-handler 'message print-message) @@ -61,7 +61,7 @@ messages from the server (loop)))))) -## possiby interesting extensions to implement. +## possibly interesting extensions to implement. see http://xmpp.org/extensions/ diff --git a/xmpp.scrbl b/xmpp.scrbl index 8af5fed..d38f670 100644 --- a/xmpp.scrbl +++ b/xmpp.scrbl @@ -9,23 +9,38 @@ A module for using the Jabber/XMPP protocol. @section{Protocol Support} -It should eventually implement XMPP-Core and XMPP-IM to conform with -RFCs 3920 and 3921. Progress toward supporting the full protocol is -currently documented in the file 'xmpp.ss' +A minimal subset of the XMPP protocols are supported, but not much +beyond sending and receiving messages and presence updates. This +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} -@schemeblock[ -(with-xmpp-session jid pass body) -] +It is necessary to establish a session with a Jabber server before +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[ (with-xmpp-session jid pass (send (message to text))) @@ -33,12 +48,15 @@ currently documented in the file 'xmpp.ss' @section{Presence} -@schemeblock[ +@schemeblock[ (with-xmpp-session jid pass (send (presence))) ] - -@section{Registration} + +@schemeblock[ +(with-xmpp-session jid pass + (send (presence #:status "Available"))) +] @section{Response Handling}