1 ;;; jabber-private.el --- jabber:iq:private API by JEP-0049
3 ;; Copyright (C) 2005 Magnus Henoch
5 ;; Author: Magnus Henoch <mange@freemail.hu>
7 ;; This file is free software; you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 2, or (at your option)
12 ;; This file is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GNU Emacs; see the file COPYING. If not, write to
19 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 ;; Boston, MA 02111-1307, USA.
23 (defun jabber-private-get (jc node-name namespace success-callback error-callback
)
24 "Retrieve an item from private XML storage.
25 The item to retrieve is identified by NODE-NAME (a symbol) and
28 On success, SUCCESS-CALLBACK is called with JC and the retrieved
31 On error, ERROR-CALLBACK is called with JC and the entire IQ
33 (jabber-send-iq jc nil
"get"
34 `(query ((xmlns .
"jabber:iq:private"))
35 (,node-name
((xmlns .
,namespace
))))
36 #'jabber-private-get-1 success-callback
37 #'(lambda (jc xml-data error-callback
)
38 (funcall error-callback jc xml-data
))
41 (defun jabber-private-get-1 (jc xml-data success-callback
)
42 (funcall success-callback jc
43 (car (jabber-xml-node-children
44 (jabber-iq-query xml-data
)))))
47 (defun jabber-private-set (jc fragment
&optional
48 success-callback success-closure-data
49 error-callback error-closure-data
)
50 "Store FRAGMENT in private XML storage.
51 SUCCESS-CALLBACK, SUCCESS-CLOSURE-DATA, ERROR-CALLBACK and
52 ERROR-CLOSURE-DATA are used as in `jabber-send-iq'."
53 (jabber-send-iq jc nil
"set"
54 `(query ((xmlns .
"jabber:iq:private"))
56 success-callback success-closure-data
57 error-callback error-closure-data
))
59 (provide 'jabber-private
)
61 ;; arch-tag: 065bd03e-40fa-11da-ab48-000a95c2fcd0