From eenge at common-lisp.net Thu Mar 2 15:51:33 2006 From: eenge at common-lisp.net (eenge) Date: Thu, 2 Mar 2006 10:51:33 -0500 (EST) Subject: [cl-xmpp-cvs] CVS cl-xmpp Message-ID: <20060302155133.923197E02C@common-lisp.net> Update of /project/cl-xmpp/cvsroot/cl-xmpp In directory clnet:/tmp/cvs-serv13898 Modified Files: cl-xmpp.lisp Log Message: fixing error handling code --- /project/cl-xmpp/cvsroot/cl-xmpp/cl-xmpp.lisp 2006/01/23 16:41:11 1.25 +++ /project/cl-xmpp/cvsroot/cl-xmpp/cl-xmpp.lisp 2006/03/02 15:51:33 1.26 @@ -1,4 +1,4 @@ -;;;; $Id: cl-xmpp.lisp,v 1.25 2006/01/23 16:41:11 eenge Exp $ +;;;; $Id: cl-xmpp.lisp,v 1.26 2006/03/02 15:51:33 eenge Exp $ ;;;; $Source: /project/cl-xmpp/cvsroot/cl-xmpp/cl-xmpp.lisp,v $ ;;;; See the LICENSE file for licensing information. @@ -196,26 +196,29 @@ (defmethod xml-element-to-event ((connection connection) (object xml-element) (name (eql :iq))) (let ((id (ensure-keyword (value (get-attribute object :id)))) - (type (ensure-keyword (value (get-attribute object :type))))) - (case id - (:error (make-error (get-element object :error))) - (:roster_1 (make-roster object)) - (:reg2 :registration-successful) - (:unreg_1 :registration-cancellation-successful) - (:change1 :password-changed-successfully) - (:auth2 :authentication-successful) - (:bind_2 :bind-successful) - (:session_1 :session-initiated) - (t - (case type - (:get (warn "Don't know how to handle IQ get yet.")) - (t - (cond - ((member id '(info1 info2 info3)) - (make-disco-info (get-element object :query))) - ((member id '(items1 items2 items3 items4)) - (make-disco-items (get-element object :query))) - (t ;; Assuming an error + (type (ensure-keyword (value (get-attribute object :type)))) + (errorp (get-element object :error))) + (if errorp + (make-error errorp) + (case id + (:error (make-error errorp)) + (:roster_1 (make-roster object)) + (:reg2 :registration-successful) + (:unreg_1 :registration-cancellation-successful) + (:change1 :password-changed-successfully) + (:auth2 :authentication-successful) + (:bind_2 :bind-successful) + (:session_1 :session-initiated) + (t + (case type + (:get (warn "Don't know how to handle IQ get yet.")) + (t + (cond + ((member id '(info1 info2 info3)) + (make-disco-info (get-element object :query))) + ((member id '(items1 items2 items3 items4)) + (make-disco-items (get-element object :query))) + (t ;; Assuming an error (make-error (get-element object :error)))))))))) (defmethod xml-element-to-event ((connection connection) From eenge at common-lisp.net Wed Mar 29 16:38:07 2006 From: eenge at common-lisp.net (eenge) Date: Wed, 29 Mar 2006 11:38:07 -0500 (EST) Subject: [cl-xmpp-cvs] CVS public_html Message-ID: <20060329163807.9DF5B2F000@common-lisp.net> Update of /project/cl-xmpp/cvsroot/public_html In directory clnet:/tmp/cvs-serv3171 Modified Files: index.html Log Message: project member listing --- /project/cl-xmpp/cvsroot/public_html/index.html 2006/02/06 15:51:32 1.30 +++ /project/cl-xmpp/cvsroot/public_html/index.html 2006/03/29 16:38:07 1.31 @@ -106,6 +106,13 @@ +

Project members

+
+
+        
+       
+
+

Sample usage




From eenge at common-lisp.net  Wed Mar 29 16:40:50 2006
From: eenge at common-lisp.net (eenge)
Date: Wed, 29 Mar 2006 11:40:50 -0500 (EST)
Subject: [cl-xmpp-cvs] CVS public_html
Message-ID: <20060329164050.F25B72F006@common-lisp.net>

Update of /project/cl-xmpp/cvsroot/public_html
In directory clnet:/home/eenge/public_htmls/cl-xmpp

Added Files:
	index.shtml 
Removed Files:
	index.html 
Log Message:
renaming



--- /project/cl-xmpp/cvsroot/public_html/index.shtml	2006/03/29 16:40:50	NONE
+++ /project/cl-xmpp/cvsroot/public_html/index.shtml	2006/03/29 16:40:50	1.1



    
      cl-xmpp 

  
    

cl-xmpp 0.7.2

cl-xmpp is a Common Lisp client implementation of the XMPP RFCs. These are the RFCs which Jabber clients and servers use to communicate with eachother (including Google Talk). In addition cl-xmpp implements JEPs 0078, 0086, 0030 and 0070 which are all part of JEP-0073: Basic IM Protocol Suite. The author considers the library feature complete but will happily accept patches for any other reasonably stable JEPs.

Currently, you can chat, manage your contacts, roster and presence information using this library. You can now also use the service discovery protocol using the xmpp:discover operator.

The code is released under an MIT-style license.

News

  • 2006-02-06: Version 0.7.2 released (Bugfixes and updated for new CXML)
  • 2005-11-21: Version 0.7.1 released (Bugfixes)
  • Version 0.7.0 released (TLS support)
  • Version 0.6.0 released (SASL support, tiny test suite and many small fixes and tweaks)
  • Version 0.5.0 released (Now depending on Ironclad for digest authentication)
  • Version 0.4.0 released (Better support for JEP0030 (service discovery) and more exported symbols)
  • Version 0.3.0 released (Added Allegro and LispWorks support)
  • Version 0.2.0 released (JEP 0073 support)
  • Version 0.1.0 released (Initial release)

Requirements

Tested against

Features

  • Implements most commands in the RFCs
  • event driven model with hooks makes interfacing easy -- or
  • access to DOM-ish structure with raw data from the server so you can do whatever you like

Installation

If you have asdf-install, just:

$ asdf-install cl-xmpp

cl-xmpp can manually be downloaded from here: cl-xmpp_latest.tar.gz .

There is also anonymous CVS and ViewCVS .

Contact

Questions, feature requests, and bug-reports are welcome on cl-xmpp-devel at common-lisp.net (archives).

Project members

 

Sample usage

  * (require :cl-xmpp)

  * (defvar *connection* (xmpp:connect :hostname "jabber.org"))
;; or xmpp:connect-tls if you loaded cl-xmpp-tls

;; note that for XMPP servers which do not have the same hostname
;; as the domain-part of the user's JID you will have to pass that
;; in.  eg for Google Talk:
;;  (defvar *connection* (xmpp:connect-tls :hostname "talk.google.com"
                                           :jid-domain-part "gmail.com"))

  * (xmpp:auth connection "password" "resource")
;; or pass :mechanism :sasl-plain, :digest-md5 or sasl-digest-md5
;; if you loaded cl-xmpp-sasl or cl-xmpp-tls.

;; send someone a message
  * (xmpp:message connection "username at hostname" "what's going on?")

;; then sit back and watch the messages roll in:
  * (xmpp:receive-stanza-loop connection)

[....]
;; or use xmpp:receive-stanza if you're just wanting one stanza
;; (note it will still block until you have received a complete
;; stanza)

;; That's it.  Interrupt the loop to issue other commands, eg:
  * (xmpp:get-roster connection)

;; or any of the other ones you may find by looking through cl-xmpp.lisp
;; and package.lisp to see which ones are exported.

;; If you wish to handle the incoming messages or other objects simply
;; specify an xmpp:handle method for the objects you are interested in
;; or (defmethod xmpp:handle (connection object) ...)  to get them
;; all.  Or alternatively specify :dom-repr t to receive-stanza-loop
;; to get DOM-ish objects.

;; For example, if you wanted to create an annoying reply bot:

 * (defmethod xmpp:handle ((connection xmpp:connection) (message xmpp:message))
    (xmpp:message connection (xmpp:from message) 
        (format nil "reply to: ~a" (xmpp:message object))))