From: Magnus H. <leg...@us...> - 2008-06-17 14:50:22
|
Update of /cvsroot/emacs-jabber/emacs-jabber/tests In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv14393/tests Modified Files: jabberd.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-538 Creator: Magnus Henoch <ma...@fr...> Fix jabberd.el for legacy authentication Index: jabberd.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/tests/jabberd.el,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- jabberd.el 17 Jun 2008 14:47:32 -0000 1.1 +++ jabberd.el 17 Jun 2008 14:50:17 -0000 1.2 @@ -12,7 +12,8 @@ indicating that it has handled the stanza.") (defvar jabberd-iq-get-handlers - '(("jabber:iq:roster" . jabberd-iq-empty-success)) + '(("jabber:iq:roster" . jabberd-iq-empty-success) + ("jabber:iq:auth" . jabberd-iq-auth-get)) "Alist of handlers for IQ get stanzas. The key is the namespace of the request (a string), and the value is a function to handle the request. The function takes two @@ -20,7 +21,8 @@ (defvar jabberd-iq-set-handlers '(("urn:ietf:params:xml:ns:xmpp-bind" . jabberd-iq-bind) - ("urn:ietf:params:xml:ns:xmpp-session" . jabberd-iq-empty-success)) + ("urn:ietf:params:xml:ns:xmpp-session" . jabberd-iq-empty-success) + ("jabber:iq:auth" . jabberd-iq-empty-success)) "Alist of handlers for IQ set stanzas. The key is the namespace of the request (a string), and the value is a function to handle the request. The function takes two @@ -65,6 +67,8 @@ (dolist (stanza stanzas) (cond ((stringp stanza) + ;; "Send" a stream start in return. + (fsm-send fsm (list :stream-start "42" "1.0")) ;; If we have a stream start, see whether it wants XMPP 1.0. ;; If so, send <stream:features>. (when (string-match "version=[\"']" stanza) @@ -124,4 +128,12 @@ (bind ((xmlns . "urn:ietf:params:xml:ns:xmpp-bind")) (jid () "ro...@mo.../Orchard")))))) +(defun jabberd-iq-auth-get (fsm stanza) + (jabber-xml-let-attributes (id) stanza + (jabberd-send + fsm + `(iq ((type . "result") (id . ,id)) + (query ((xmlns . "jabber:iq:auth")) + (username) (password) (digest) (resource)))))) + (provide 'jabberd) |