[cl-xmpp-devel] presence patch

Julian Stecklina der_julian at web.de
Sun Aug 27 13:04:28 EDT 2006


Hello,

the attached patch adds support for status messages and priorities.

Regards,
Julian
-------------- next part --------------
? presence.patch
Index: cl-xmpp.lisp
===================================================================
RCS file: /project/cl-xmpp/cvsroot/cl-xmpp/cl-xmpp.lisp,v
retrieving revision 1.27
diff -u -r1.27 cl-xmpp.lisp
--- cl-xmpp.lisp	12 May 2006 17:45:49 -0000	1.27
+++ cl-xmpp.lisp	27 Aug 2006 16:56:08 -0000
@@ -487,13 +487,22 @@
 
 (add-auth-method :digest-md5 '%digest-md5-auth%)
 
-(defmethod presence ((connection connection) &key type to)
+(defmethod presence ((connection connection) &key type to status show priority)
   (with-xml-output (connection)
    (cxml:with-element "presence"
     (when type
       (cxml:attribute "type" type))
     (when to
-      (cxml:attribute "to" to)))))
+      (cxml:attribute "to" to))
+    (when status
+      (cxml:with-element "status"
+	(cxml:text status)))
+    (when show
+      (cxml:with-element "show"
+	(cxml:text show)))
+    (when priority
+      (cxml:with-element "priority"
+	(cxml:text (format nil "~A" priority)))))))
    
 (defmethod message ((connection connection) to body &key id (type :chat))
   (with-xml-output (connection)


More information about the cl-xmpp-devel mailing list