]>
Commit | Line | Data |
---|---|---|
1 | ;ELC\1c\0\0\0 | |
2 | ;;; Compiled | |
3 | ;;; in Emacs version 28.2 | |
4 | ;;; with all optimizations. | |
5 | ||
6 | ||
7 | ||
8 | (byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305\306\"\207" [require jabber-iq jabber-xml jabber-menu eval-after-load "jabber-core" #[0 "\300\301\302\"\207" [add-to-list jabber-presence-chain jabber-process-caps] 3]] 3) | |
9 | (defvar jabber-caps-cache (make-hash-table :test 'equal)) | |
10 | #@207 Hash function name map. | |
11 | Maps names defined in http://www.iana.org/assignments/hash-function-text-names | |
12 | to symbols accepted by `secure-hash'. | |
13 | ||
14 | XEP-0115 currently recommends SHA-1, but let's be future-proof.\1f | |
15 | (defconst jabber-caps-hash-names (byte-code "\300\301!\203\b\0\302\207\303\207" [fboundp secure-hash (("sha-1" . sha1) ("sha-224" . sha224) ("sha-256" . sha256) ("sha-384" . sha384) ("sha-512" . sha512)) (("sha-1" . sha1))] 2) (#$ . 374)) | |
16 | #@158 Get disco info from Entity Capabilities cache. | |
17 | JID should be a string containing a full JID. | |
18 | Return (IDENTITIES FEATURES), or nil if not in cache. | |
19 | ||
20 | (fn JID)\1f | |
21 | (defalias 'jabber-caps-get-cached #[257 "\301\ 1!\302\ 2!\206\n\0\303\304\ 1\ 3\305N\"A\306\ 1\307\"\211\205-\0\310\ 1\b\"\211:\205+\0\311\ 1@!?\205+\0\211\262\ 1\207" [jabber-caps-cache jabber-jid-symbol jabber-jid-resource "" assoc resources plist-get caps gethash floatp] 8 (#$ . 824)]) | |
22 | #@192 Look for entity capabilities in presence stanzas. | |
23 | ||
24 | JC is the Jabber connection. | |
25 | XML-DATA is the parsed tree data from the stream (stanzas) | |
26 | obtained from `xml-parse-region'. | |
27 | ||
28 | (fn JC XML-DATA)\1f | |
29 | (defalias 'jabber-process-caps #[514 "\211\300\ 1:\205\v\0\301\ 2\ 2\"\266\202\ 1\302\ 1:\205\18\0\301\ 2\ 2\"\266\202\303\ 3\304\"\ 1?\205m\0\211\205m\0\211\305\ 1:\2052\0\301\ 2\ 2\"\266\ 3\306\ 1\307\ 1:\205@\0\301\ 2\ 2\"\266\202\ 2\310\ 1:\205M\0\301\ 2\ 2\"\266\202\ 3\311\ 1:\205Z\0\301\ 2\ 2\"\266\202\ 2\203j\0\312\ 6 \ 6\b\ 5\ 5\ 5%\207\266\ 4\313\207" [from xml-get-attribute-or-nil type jabber-xml-path (("http://jabber.org/protocol/caps" . "c")) ext nil hash node ver jabber-process-caps-modern t] 15 (#$ . 1257)]) | |
30 | #@29 | |
31 | ||
32 | (fn JC JID HASH NODE VER)\1f | |
33 | (defalias 'jabber-process-caps-modern #[1285 "\303\ 3\b\"\205\256\0\ 2\ 1B\304\ 1 \"\305\ 6\ 6!\306\ 6\a!\206\1a\0\307\303\ 1\ 3\310N\"\311\ 1A\312\ 6\a#\ 1\2033\0\ 1\ 1\241\266\ 5\202B\0\ 2\ 1B\313\ 5\310\ 3\ 6\b\310NB#\266\ 6\314\ 1:\203\210\0\315\ 2@!\203\210\0\316 \ 2@Z\317W\203t\0\ 1\211A\320\ 6 \ 2\321\322$\203j\0\211\202n\0\ 6\b\ 1B\262\ 1\241\202\252\0\ 1\316 \240\210\211\ 6\b\ 6\b\ 6\b\ 6\b\ 6\b%\202\252\0\ 1\204\243\0\323\ 3\316 C #\210\211\ 6\b\ 6\b\ 6\b\ 6\b\ 6\b%\202\252\0\323\ 6\aC\ 3\n#\262\ 1\266\202\207" [jabber-caps-hash-names jabber-caps-cache jabber-disco-info-cache assoc gethash jabber-jid-symbol jabber-jid-resource "" resources plist-put caps put #[1285 "\300\ 5\ 5\301\302\303\304\ 6\b\305\ 6 QBDD\306\ 6\b\ 6\b\ 6\bE\307\ 6\n\ 6\n\ 6\nE&\b\207" [jabber-send-iq "get" query (xmlns . "http://jabber.org/protocol/disco#info") node "#" jabber-process-caps-info-result jabber-process-caps-info-error] 16 "\n\n(fn JC JID HASH NODE VER)"] floatp float-time 10.0 cl-member :test string= puthash] 18 (#$ . 1905)]) | |
34 | #@33 | |
35 | ||
36 | (fn JC XML-DATA CLOSURE-DATA)\1f | |
37 | (defalias 'jabber-process-caps-info-result #[771 "\211\ 1G\301U\203\11\0\ 1\211A\262\ 2\242\202\18\0\302\303\304\ 3GD\"\ 1\211A\262\ 3\242\ 2\242\ 2\ 1B\305\ 6\a!\306\ 1\ 6\ 6\"\ 3\ 1\230\203;\0\307\ 3\310\ 6\v!\b#\207\311\ 6\n\ 6\a\ 6\a\ 6\a$\207" [jabber-caps-cache 3 signal wrong-number-of-arguments (hash node ver) jabber-iq-query jabber-caps-ver-string puthash jabber-disco-parse-info jabber-caps-try-next] 15 (#$ . 2828)]) | |
38 | #@33 | |
39 | ||
40 | (fn JC XML-DATA CLOSURE-DATA)\1f | |
41 | (defalias 'jabber-process-caps-info-error #[771 "\211\ 1G\300U\203\11\0\ 1\211A\262\ 2\242\202\18\0\301\302\303\ 3GD\"\ 1\211A\262\ 3\242\ 2\242\304\ 6\a\ 4\ 4\ 4$\207" [3 signal wrong-number-of-arguments (hash node ver) jabber-caps-try-next] 12 (#$ . 3240)]) | |
42 | #@25 | |
43 | ||
44 | (fn JC HASH NODE VER)\1f | |
45 | (defalias 'jabber-caps-try-next #[1028 "\ 2\ 1B\301\ 1\b\"\302\ 1\242!\205N\0\211A\211\ 2\ 2A\241\210\262\ 1\242\211\203H\0\ 1\303 \240\210\304\ 6\a\ 2\305\306\307\310\ 6\v\311\ 6\fQBDD\312\ 6\v\ 6\v\ 6\vE\313\ 6\r\ 6\r\ 6\rE&\b\202L\0\314\ 3\b\"\262\ 1\207" [jabber-caps-cache gethash floatp float-time jabber-send-iq "get" query (xmlns . "http://jabber.org/protocol/disco#info") node "#" jabber-process-caps-info-result jabber-process-caps-info-error remhash] 18 (#$ . 3509)]) | |
46 | #@19 | |
47 | ||
48 | (fn QUERY HASH)\1f | |
49 | (defalias 'jabber-caps-ver-string #[514 "\301\302\303\"r\211q\210\304\305\ 2\"\216\306\ 3\307\"\310\311\306\ 6\ 6\312\"\"\306\ 5\313\"\314\315\ 2\"\316\ 4\317\"\262\ 4\ 3\211\203w\0\211@\211\320\ 1:\2059\0\321\ 2\ 2\"\266\202\ 1\322\ 1:\205F\0\321\ 2\ 2\"\266\202\ 2\323\ 1:\205S\0\321\ 2\ 2\"\266\202\ 3\324\ 1:\205`\0\321\ 2\ 2\"\266\202\ 3\325\ 4\325\ 5\325\ 6\ 6\326\260\bc\266\ 5\ 1A\266\202\202(\0\210\316\ 3\327\"\262\ 3\ 2\211\203\221\0\211@\211\326\261\ 2\210\ 1A\266\202\202\7f\0\210\316\ 1\330\"\262\ 1\211\211\203\ 6\ 1\211@\331\ 1!\326\261\ 2\210\316\306\ 2\332\"\333\"\211\211\203\375\0\211@\211\334\ 1:\205\277\0\321\ 2\ 2\"\266\202\335\230\204\366\0\211\334\ 1:\205\321\0\321\ 2\ 2\"\266\202\326\261\ 2\210\316\310\336\306\ 4\337\"\"\327\"\211\211\203\364\0\211@\211\326\261\ 2\210\ 1A\266\202\202\342\0\266\ 2\ 1A\266\202\202\256\0\266\ 2\ 1A\266\202\202\231\0\266\ 5\340\341 \342\303#\343\ 3\b\"A\344\345\ 2\ 4\"\303\"\266\202*\207" [jabber-caps-hash-names generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \0\302\300!\207" [V0 buffer-name kill-buffer] 2] jabber-xml-get-children identity mapcar #[257 "\211\300\ 1:\205\v\0\301\ 2\ 2\"\207" [var xml-get-attribute-or-nil] 6 "\n\n(fn F)"] feature x cl-remove-if-not #[257 "\211\211\300\ 1:\205\f\0\301\ 2\ 2\"\266\203\302\230\205\16\0\303\ 1!\207" [xmlns xml-get-attribute-or-nil "jabber:x:data" jabber-xdata-formtype] 7 "\n\n(fn X)"] sort jabber-caps-identity-< category xml-get-attribute-or-nil type xml:lang name "/" "<" string< #[514 "\300\ 2!\300\ 2!\231\207" [jabber-xdata-formtype] 5 "\n\n(fn A B)"] jabber-xdata-formtype field #[514 "\ 1\300\ 1:\205\v\0\301\ 2\ 2\"\266\202\ 1\300\ 1:\205\18\0\301\ 2\ 2\"\266\202\231\207" [var xml-get-attribute-or-nil] 8 "\n\n(fn A B)"] var "FORM_TYPE" #[257 "\211\211AA\211\300\232?\205\f\0\211\266\202@\207" [((""))] 5 "\n\n(fn VALUE)"] value encode-coding-string buffer-string utf-8 assoc base64-encode-string jabber-caps--secure-hash] 21 (#$ . 3964)]) | |
50 | #@25 | |
51 | ||
52 | (fn ALGORITHM STRING)\1f | |
53 | (defalias 'jabber-caps--secure-hash #[514 "\300\301!\203\ e\0\301\ 2\ 2\302\211\303%\207\ 1\304=\203\e\0\304\ 1\302\211\303$\207\305\306\ 3\"\207" [fboundp secure-hash nil t sha1 error "Cannot use hash algorithm %s!"] 8 (#$ . 5779)]) | |
54 | #@12 | |
55 | ||
56 | (fn A B)\1f | |
57 | (defalias 'jabber-caps-identity-< #[514 "\ 1\300\ 1:\205\v\0\301\ 2\ 2\"\266\202\ 1\300\ 1:\205\18\0\301\ 2\ 2\"\266\202\ 1\ 1\231\206m\0\ 1\ 1\230\205m\0\ 3\302\ 1:\2051\0\301\ 2\ 2\"\266\202\ 3\302\ 1:\205>\0\301\ 2\ 2\"\266\202\ 1\ 1\231\206k\0\ 1\ 1\230\205k\0\ 5\303\ 1:\205W\0\301\ 2\ 2\"\266\202\ 5\303\ 1:\205d\0\301\ 2\ 2\"\266\202\ 1\ 1\231\266\202\266\202\207" [category xml-get-attribute-or-nil type xml:lang] 12 (#$ . 6028)]) | |
58 | #@116 Hash function to use when sending caps in presence stanzas. | |
59 | The value should be a key in `jabber-caps-hash-names'.\1f | |
60 | (defvar jabber-caps-default-hash-function "sha-1" (#$ . 6404)) | |
61 | #@63 The current disco hash we're sending out in presence stanzas.\1f | |
62 | (defvar jabber-caps-current-hash nil (#$ . 6588)) | |
63 | (defconst jabber-caps-node "http://emacs-jabber.sourceforge.net") | |
64 | #@16 | |
65 | ||
66 | (fn FEATURE)\1f | |
67 | (defalias 'jabber-disco-advertise-feature #[257 "\211\b\235?\205\16\0\211\bB\10 \205\16\0\303 \210\304\305\n\"\207" [jabber-advertised-features jabber-caps-current-hash jabber-connections jabber-caps-recalculate-hash mapc jabber-send-current-presence] 4 (#$ . 6772)]) | |
68 | #@140 Update `jabber-caps-current-hash' for feature list change. | |
69 | Also update `jabber-disco-info-nodes', so we return results for | |
70 | the right node.\1f | |
71 | (defalias 'jabber-caps-recalculate-hash #[0 "\b\211\205 \0 \304\ 2Q\305\306\307\310 BB\n\" \304\ 2Q\ 2\203(\0\311\ 3\v\"\211\203'\0\312\ 1\v\"\13\210\211\310\307E\vB\13\ 1\211\10\207" [jabber-caps-current-hash jabber-caps-node jabber-caps-default-hash-function jabber-disco-info-nodes "#" jabber-caps-ver-string query nil jabber-disco-return-client-info assoc delq] 8 (#$ . 7052)]) | |
72 | #@11 | |
73 | ||
74 | (fn JC)\1f | |
75 | (defalias 'jabber-caps-presence-element #[257 "\b\204\a\0\303 \210\304\305\306 B\307\nB\310\bBFDC\207" [jabber-caps-current-hash jabber-caps-default-hash-function jabber-caps-node jabber-caps-recalculate-hash c (xmlns . "http://jabber.org/protocol/caps") hash node ver] 7 (#$ . 7554)]) | |
76 | (eval-after-load "jabber-presence" #[0 "\300\301\302\"\207" [add-to-list jabber-presence-element-functions jabber-caps-presence-element] 3]) | |
77 | #@148 Features advertised on service discovery requests. | |
78 | ||
79 | Don't add your feature to this list directly. Instead, call | |
80 | `jabber-disco-advertise-feature'.\1f | |
81 | (defvar jabber-advertised-features (list "http://jabber.org/protocol/disco#info") (#$ . 7994)) | |
82 | #@643 Alist of node names and information about returning disco item data. | |
83 | Key is node name as a string, or "" for no node specified. Value is | |
84 | a list of two items. | |
85 | ||
86 | First item is data to return. If it is a function, that function is | |
87 | called and its return value is used; if it is a list, that list is | |
88 | used. The list should be the XML data to be returned inside the | |
89 | <query/> element, like this: | |
90 | ||
91 | ((item ((name . "Name of first item") | |
92 | (jid . "first.item") | |
93 | (node . "node")))) | |
94 | ||
95 | Second item is access control function. That function is passed the | |
96 | JID, and returns non-nil if access is granted. If the second item is | |
97 | nil, access is always granted.\1f | |
98 | (defvar jabber-disco-items-nodes (byte-code "\300\301\211EC\207" ["" nil] 3) (#$ . 8243)) | |
99 | #@679 Alist of node names and information returning disco info data. | |
100 | Key is node name as a string, or "" for no node specified. Value is | |
101 | a list of two items. | |
102 | ||
103 | First item is data to return. If it is a function, that function is | |
104 | called and its return value is used; if it is a list, that list is | |
105 | used. The list should be the XML data to be returned inside the | |
106 | <query/> element, like this: | |
107 | ||
108 | ((identity ((category . "client") | |
109 | (type . "pc") | |
110 | (name . "Jabber client"))) | |
111 | (feature ((var . "some-feature")))) | |
112 | ||
113 | Second item is access control function. That function is passed the | |
114 | JID, and returns non-nil if access is granted. If the second item is | |
115 | nil, access is always granted.\1f | |
116 | (defvar jabber-disco-info-nodes (byte-code "\300\301\302EC\207" ["" jabber-disco-return-client-info nil] 3) (#$ . 8982)) | |
117 | (byte-code "\300\301\302\303B\"\210\300\301\304\303B\"\207" [add-to-list jabber-iq-get-xmlns-alist "http://jabber.org/protocol/disco#info" jabber-return-disco-info "http://jabber.org/protocol/disco#items"] 4) | |
118 | #@196 Respond to a service discovery request. | |
119 | See XEP-0030. | |
120 | ||
121 | JC is the Jabber connection. | |
122 | XML-DATA is the parsed tree data from the stream (stanzas) | |
123 | obtained from `xml-parse-region'. | |
124 | ||
125 | (fn JC XML-DATA)\1f | |
126 | (defalias 'jabber-return-disco-info #[514 "\211\300\ 1:\205\v\0\301\ 2\ 2\"\266\202\ 1\302\ 1:\205\18\0\301\ 2\ 2\"\266\202\303\ 3!\304\305\ 2\306\307B\310\311BD\"A!\312\ 5!\313\ 1:\2057\0\301\ 2\ 2\"\266\202\206=\0\314\305\ 1\ 3\"A\211@\ 1A@\ 2\203\222\0\315\ 1!\203_\0\211\ 6\n\ 6 \"\204_\0\316\317\320\"\207\315\ 2!\203n\0\ 1\ 6\n\ 6\n\"\202o\0\ 1\321\ 6\v\ 6\n\322\323\324\ 6\fB\ 6\n\205\204\0\313\ 6\vBCB\ 6\ 6BB\325\211\211\211\ 6\10& \207\316\317\326\"\207" [from xml-get-attribute-or-nil id jabber-iq-xmlns eval assoc "http://jabber.org/protocol/disco#info" jabber-disco-info-nodes "http://jabber.org/protocol/disco#items" jabber-disco-items-nodes jabber-iq-query node "" functionp jabber-signal-error "Cancel" not-allowed jabber-send-iq "result" query xmlns nil item-not-found] 21 (#$ . 9997)]) | |
127 | #@30 | |
128 | ||
129 | (fn &optional JC XML-DATA)\1f | |
130 | (defalias 'jabber-disco-return-client-info #[512 "\302\303\304\305\b\306>\203\ e\0\307\202\ f\0\310BED\311\312 \"B\207" [window-system jabber-advertised-features identity (category . "client") (name . "Emacs Jabber client") type (x w32 mac ns) "pc" "console" mapcar #[257 "\300\301\ 2BCD\207" [feature var] 4 "\n\n(fn FEATURENAME)"]] 8 (#$ . 10919)]) | |
131 | (byte-code "\300\301\302\303B\"\207" [add-to-list jabber-jid-info-menu "Send items disco query" jabber-get-disco-items] 4) | |
132 | #@102 Send a service discovery request for items. | |
133 | ||
134 | JC is the Jabber connection. | |
135 | ||
136 | (fn JC TO &optional NODE)\1f | |
137 | (defalias 'jabber-get-disco-items #[770 "\300\ 3\ 3\301\302\303\304\305BC\ 6\aG\306V\205\17\0\307\ 6\bBC\"D\310\311\310\312&\b\207" [jabber-send-iq "get" query append xmlns "http://jabber.org/protocol/disco#items" 0 node jabber-process-data jabber-process-disco-items "Item discovery failed"] 12 (#$ . 11420) (byte-code "\300 \301\302\303\211\211\304\305&\ 6\306\307!E\207" [jabber-read-account jabber-read-jid-completing "Send items disco request to: " nil full t jabber-read-node "Node (or leave empty): "] 8)]) | |
138 | (byte-code "\300\301\302\303B\"\207" [add-to-list jabber-jid-info-menu "Send info disco query" jabber-get-disco-info] 4) | |
139 | #@101 Send a service discovery request for info. | |
140 | ||
141 | JC is the Jabber connection. | |
142 | ||
143 | (fn JC TO &optional NODE)\1f | |
144 | (defalias 'jabber-get-disco-info #[770 "\300\ 3\ 3\301\302\303\304\305BC\ 6\aG\306V\205\17\0\307\ 6\bBC\"D\310\311\310\312&\b\207" [jabber-send-iq "get" query append xmlns "http://jabber.org/protocol/disco#info" 0 node jabber-process-data jabber-process-disco-info "Info discovery failed"] 12 (#$ . 12147) (byte-code "\300 \301\302\303\211\211\304\305&\ 6\306\307!E\207" [jabber-read-account jabber-read-jid-completing "Send info disco request to: " nil full t jabber-read-node "Node (or leave empty): "] 8)]) | |
145 | #@183 Handle results from info disco requests. | |
146 | ||
147 | JC is the Jabber connection. | |
148 | XML-DATA is the parsed tree data from the stream (stanzas) | |
149 | obtained from `xml-parse-region'. | |
150 | ||
151 | (fn JC XML-DATA)\1f | |
152 | (defalias 'jabber-process-disco-info #[514 "`\300\ 2!\211AA\211\301\232?\205\ f\0\211\266\202\211\203\233\0\211@\211\211<\205\1f\0\211@\262\ 1\302=\203q\0\211\303\ 1:\2051\0\304\ 2\ 2\"\266\202\ 1\305\ 1:\205>\0\304\ 2\ 2\"\266\202\ 2\306\ 1:\205K\0\304\ 2\ 2\"\266\202\307\ 3\203V\0\ 3\202W\0\310\311\312#\313\ 3\314\261\ 4\210\211\203j\0\315\ 1\314\261\ 3\210\314c\266\ 4\202\224\0\211\211<\205y\0\211@\262\ 1\316=\203\224\0\211\317\ 1:\205\213\0\304\ 2\ 2\"\266\202\320\ 1\314\261\ 3\266\ 2\ 1A\266\202\202\11\0\210\321\ 1`\322\ 5\323\ 1:\205\253\0\304\ 2\ 2\"\266\202$\210\321\ 1`\324\ 6\ 6$\207" [jabber-iq-query (("")) identity name xml-get-attribute-or-nil category type jabber-propertize "Unnamed" face jabber-title-medium "\n\nCategory: " "\n" "Type: " feature var "Feature: " put-text-property jabber-jid from jabber-account] 12 (#$ . 12748)]) | |
153 | #@184 Handle results from items disco requests. | |
154 | ||
155 | JC is the Jabber connection. | |
156 | XML-DATA is the parsed tree data from the stream (stanzas) | |
157 | obtained from `xml-parse-region'. | |
158 | ||
159 | (fn JC XML-DATA)\1f | |
160 | (defalias 'jabber-process-disco-items #[514 "\300\301\ 2!\302\"\211\203a\0\211\211\205`\0\211@\211\303\ 1:\205\1c\0\304\ 2\ 2\"\266\202\ 1\305\ 1:\205)\0\304\ 2\ 2\"\266\202\ 2\306\ 1:\2056\0\304\ 2\ 2\"\266\202\307\211\ 4\310\ 4\205E\0\311\312\ 6\ 6\"Q\313\314#\ 3\315Q\316\ 5\317\ 6\f\320\ 6\a&\ac\266\ 4\ 1A\266\202\202\v\0\207\321c\207" [jabber-xml-get-children jabber-iq-query item jid xml-get-attribute-or-nil name node jabber-propertize "\n" format "Node: %s\n" face jabber-title-medium "\n\n" jabber-jid jabber-account jabber-node "No items found.\n"] 16 (#$ . 13698)]) | |
161 | (defvar jabber-disco-info-cache (make-hash-table :test 'equal)) | |
162 | (defvar jabber-disco-items-cache (make-hash-table :test 'equal)) | |
163 | #@536 Get disco info for JID and NODE, using connection JC. | |
164 | Call CALLBACK with JC and CLOSURE-DATA as first and second | |
165 | arguments and result as third argument when result is available. | |
166 | On success, result is (IDENTITIES FEATURES), where each identity is ["name" | |
167 | "category" "type"], and each feature is a string. | |
168 | On error, result is the error node, recognizable by (eq (car result) 'error). | |
169 | ||
170 | If CALLBACK is nil, just fetch data. If FORCE is non-nil, | |
171 | invalidate cache and get fresh data. | |
172 | ||
173 | (fn JC JID NODE CALLBACK CLOSURE-DATA &optional FORCE)\1f | |
174 | (defalias 'jabber-disco-get-info #[1541 "\211\203\v\0\301\ 5\ 5B\b\"\210\211?\205\14\0\302\ 5\ 5\"\211\203*\0\ 3\205L\0\303\304\305\ 6\ 6\ 6\n\ 6\a\ 6\ 6&\ 6\207\306\ 6\a\ 6\a\307\310\311\ 6\n\205<\0\312\ 6\vBCBD\313\ 6 \ 6 B\314\ 6\v\ 6\vB&\b\207" [jabber-disco-info-cache remhash jabber-disco-get-info-immediately run-with-timer 0 nil jabber-send-iq "get" query (xmlns . "http://jabber.org/protocol/disco#info") node jabber-disco-got-info #[771 "\211@\205\ e\0\211@\ 3\ 2A\300\ 5!#\207" [jabber-iq-error] 8 "\n\n(fn JC XML-DATA CALLBACK-DATA)"]] 17 (#$ . 14539)]) | |
175 | #@34 | |
176 | ||
177 | (fn JC XML-DATA CALLBACK-DATA)\1f | |
178 | (defalias 'jabber-disco-got-info #[771 "\ 1\301\ 1:\205\v\0\302\ 2\ 2\"\266\202\303\ 3!\304\ 1:\205\1a\0\302\ 2\ 2\"\266\202\305\ 4!\306\ 3\ 3B\ 2\b#\210\ 3@\2054\0\ 3@\ 6\ 6\ 5A\ 3#\207" [jabber-disco-info-cache from xml-get-attribute-or-nil jabber-iq-query node jabber-disco-parse-info puthash] 10 (#$ . 15581)]) | |
179 | #@243 Extract data from an <iq/> stanza containing a disco#info result. | |
180 | See `jabber-disco-get-info' for a description of the return value. | |
181 | ||
182 | XML-DATA is the parsed tree data from the stream (stanzas) | |
183 | obtained from `xml-parse-region'. | |
184 | ||
185 | (fn XML-DATA)\1f | |
186 | (defalias 'jabber-disco-parse-info #[257 "\300\301\302\303\ 4!\304\"\"\300\305\302\303\ 5!\306\"\"D\207" [mapcar #[257 "\300\ 1\301\ 1:\205\f\0\302\ 2\ 2\"\266\202\ 2\303\ 1:\205\19\0\302\ 2\ 2\"\266\202\ 3\304\ 1:\205&\0\302\ 2\ 2\"\266\202#\207" [vector name xml-get-attribute-or-nil category type] 9 "\n\n(fn ID)"] jabber-xml-get-children jabber-iq-query identity #[257 "\211\300\ 1:\205\v\0\301\ 2\ 2\"\207" [var xml-get-attribute-or-nil] 6 "\n\n(fn FEATURE)"] feature] 7 (#$ . 15893)]) | |
187 | #@135 Get cached disco info for JID and NODE. | |
188 | Return nil if no info available. | |
189 | ||
190 | Fill the cache with `jabber-disco-get-info'. | |
191 | ||
192 | (fn JID NODE)\1f | |
193 | (defalias 'jabber-disco-get-info-immediately #[514 "\301\ 2\ 2B\b\"\206\11\0\211?\205\11\0\302\ 2!\207" [jabber-disco-info-cache gethash jabber-caps-get-cached] 5 (#$ . 16592)]) | |
194 | #@523 Get disco items for JID and NODE, using connection JC. | |
195 | Call CALLBACK with JC and CLOSURE-DATA as first and second | |
196 | arguments and items result as third argument when result is | |
197 | available. | |
198 | On success, result is a list of items, where each | |
199 | item is ["name" "jid" "node"] (some values may be nil). | |
200 | On error, result is the error node, recognizable by (eq (car result) 'error). | |
201 | ||
202 | If CALLBACK is nil, just fetch data. If FORCE is non-nil, | |
203 | invalidate cache and get fresh data. | |
204 | ||
205 | (fn JC JID NODE CALLBACK CLOSURE-DATA &optional FORCE)\1f | |
206 | (defalias 'jabber-disco-get-items #[1541 "\211\203\v\0\301\ 5\ 5B\b\"\210\302\ 5\ 5B\b\"\211\203'\0\ 3\205I\0\303\304\305\ 6\ 6\ 6\n\ 6\a\ 6\ 6&\ 6\207\306\ 6\a\ 6\a\307\310\311\ 6\n\2059\0\312\ 6\vBCBD\313\ 6 \ 6 B\314\ 6\v\ 6\vB&\b\207" [jabber-disco-items-cache remhash gethash run-with-timer 0 nil jabber-send-iq "get" query (xmlns . "http://jabber.org/protocol/disco#items") node jabber-disco-got-items #[771 "\211@\205\ e\0\211@\ 3\ 2A\300\ 5!#\207" [jabber-iq-error] 8 "\n\n(fn JC XML-DATA CALLBACK-DATA)"]] 17 (#$ . 16898)]) | |
207 | #@34 | |
208 | ||
209 | (fn JC XML-DATA CALLBACK-DATA)\1f | |
210 | (defalias 'jabber-disco-got-items #[771 "\ 1\301\ 1:\205\v\0\302\ 2\ 2\"\266\202\303\ 3!\304\ 1:\205\1a\0\302\ 2\ 2\"\266\202\305\306\307\303\ 6\a!\310\"\"\311\ 3\ 3B\ 2\b#\210\ 3@\205;\0\ 3@\ 6\ 6\ 5A\ 3#\207" [jabber-disco-items-cache from xml-get-attribute-or-nil jabber-iq-query node mapcar #[257 "\300\ 1\301\ 1:\205\f\0\302\ 2\ 2\"\266\202\ 2\303\ 1:\205\19\0\302\ 2\ 2\"\266\202\ 3\304\ 1:\205&\0\302\ 2\ 2\"\266\202#\207" [vector name xml-get-attribute-or-nil jid node] 9 "\n\n(fn ITEM)"] jabber-xml-get-children item puthash] 10 (#$ . 17896)]) | |
211 | #@17 | |
212 | ||
213 | (fn JID NODE)\1f | |
214 | (defalias 'jabber-disco-get-items-immediately #[514 "\301\ 2\ 2B\b\"\207" [jabber-disco-items-cache gethash] 5 (#$ . 18415)]) | |
215 | #@90 Publish the given item under disco node NODE. | |
216 | ||
217 | (fn JC NODE ITEM-NAME ITEM-JID ITEM-NODE)\1f | |
218 | (defalias 'jabber-disco-publish #[1285 "\300\ 5\301\302\303\304\ 6 \205\10\0\305\ 6\nBCB\306\307\310\ 6\nB\311\ 6\f\205\"\0\312\ 6\rBC\ 6\v\205,\0\305\ 6\fBC\"BBDE\313\314\313\314&\b\207" [jabber-send-iq nil "set" query (xmlns . "http://jabber.org/protocol/disco#items") node item (action . "update") jid append name jabber-report-success "Disco publish"] 18 (#$ . 18558)]) | |
219 | #@114 Remove the given item from published disco items. | |
220 | ||
221 | JC is the Jabber connection. | |
222 | ||
223 | (fn JC NODE ITEM-JID ITEM-NODE)\1f | |
224 | (defalias 'jabber-disco-publish-remove #[1028 "\300\ 4\301\302\303\304\ 6\b\205\10\0\305\ 6 BCB\306\307\310\ 6\nB\ 6 \205!\0\305\ 6\nBCBBDE\311\312\311\312&\b\207" [jabber-send-iq nil "set" query (xmlns . "http://jabber.org/protocol/disco#items") node item (action . "remove") jid jabber-report-success "Disco removal"] 15 (#$ . 19004)]) | |
225 | (provide 'jabber-disco) |