;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (require 'cl) (defvar jabber-export-roster-widget nil) (defvar jabber-import-subscription-p-widget nil) #@34 Export roster for connection JC. (defalias 'jabber-export-roster #[(jc) "\302!\303\304\305 \306\"!!)\207" [jc state-data fsm-get-state-data jabber-export-roster-do-it jabber-roster-to-sexp plist-get :roster] 5 (#$ . 191) (list (jabber-read-account))]) #@60 Create buffer from which ROSTER can be exported to a file. (defalias 'jabber-export-roster-do-it #[(roster) "r\301\302!q\210\303\304!\210\305\306\307\310\311#!\210\305\312!\210\313\314\315\316\317$\210\305\320!\210\313\314\315\321\322$\210\305\323!\210\324\325!\210\326!\210\327 \210\330\331!\210eb\210\332p!)\207" [roster get-buffer-create "Export roster" jabber-init-widget-buffer nil widget-insert jabber-propertize "Export roster\n" face jabber-title-large "You are about to save your roster to a file. Here\nyou can edit it before saving. Changes done here will\nnot affect your actual roster.\n\n" widget-create push-button :notify jabber-export-save "Save to file" " " jabber-export-remove-regexp "Remove by regexp" "\n\n" make-local-variable jabber-export-roster-widget jabber-export-display widget-setup widget-minor-mode 1 switch-to-buffer] 5 (#$ . 451) nil]) #@62 Create buffer for roster import for connection JC from FILE. (defalias 'jabber-import-roster #[(jc file) "\306\307\310\"rq\210\311\216\312\313\314\n!@!,r\315\316!q\210\f\317\320!\210\321\322\323\324\325#!\210\321\326!\210\327\330!\210\331\332!\321\333!\210\331\334\335\336\337$\210\321\340!\210\331\334\335\341\342$\210\321\343!\210\327\344!\210\345 !\210\346 \210\347\350!\210eb\210\351p!*\207" [#1=#:temp-buffer coding-system-for-read file roster jc jabber-buffer-connection generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] utf-8 jabber-roster-xml-to-sexp xml-parse-file get-buffer-create "Import roster" jabber-init-widget-buffer nil widget-insert jabber-propertize "Import roster\n" face jabber-title-large "You are about to import the contacts below to your roster.\n\n" make-local-variable jabber-import-subscription-p-widget widget-create checkbox " Adjust subscriptions\n" push-button :notify jabber-import-doit "Import to roster" " " jabber-export-remove-regexp "Remove by regexp" "\n\n" jabber-export-roster-widget jabber-export-display widget-setup widget-minor-mode 1 switch-to-buffer] 5 (#$ . 1330) (list (jabber-read-account) (read-file-name "Import roster from file: "))]) (defalias 'jabber-export-remove-regexp #[(&rest ignore) "\304!\211G\305\306!\307\310 \"\311 \"\210\312 \210\313\314\n GZ\"+\207" [jabber-export-roster-widget value length-before regexp widget-value read-string "Remove JIDs matching regexp: " delete-if #[(a) "\302 @\"\207" [regexp a string-match] 3] widget-value-set widget-setup message "%d items removed"] 5]) #@24 Export roster to file. (defalias 'jabber-export-save #[(&rest ignore) "\306\307\310!\"\311\312\313!\314\315\316\"\317\216r q\210\320c\210\n\321\211\2038@\322 !\323\261\210A\211\204$*\324c\210)r q\210\325\321\211\f\321\326%\210,\327\330!*\207" [jabber-export-roster-widget coding-system-for-write items #1=#:temp-buffer #2=#:temp-file item mapcar jabber-roster-sexp-to-xml widget-value utf-8 read-file-name "Export roster to file: " generate-new-buffer " *temp file*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] "\n" nil jabber-sexp2xml "\n" "\n" write-region 0 message "Roster saved" --dolist-tail--] 7 (#$ . 2947)]) #@39 Import roster being edited in widget. (defalias 'jabber-import-doit #[(&rest ignore) "\306!\307 \310\"\311\312\f!\311\211(\203(@\211@) A@G\313U?\205+ A@\314 8\315 8\316)!\211*\n>\211+\205J*\317N,+\205U*\320N-+\205`*\321N.+\203\216\203q,\203\216\203\203,\203\203,\230\203\216\322.\323\324$\203\247\325)\206\230,\311\326.\323\324$F\327\" B\312/!\203 \330\235\331\235-\332\235-\333\2350123\3344\335K5\336\216\3354M\2103\203\3451\204\345\335\337!\210\202\3631\203\3633\204\363\335\340!\2102\203\3750\203 0\203 2\204 \335\341!\210.. (A\211(\204* \205,\342\311\343\344\345 BB\346\347\346\347&+\207" [jabber-buffer-connection state-data jabber-roster roster-delta jabber-export-roster-widget n fsm-get-state-data plist-get :roster nil widget-value 0 2 3 jabber-jid-symbol name subscription groups set-difference :test string= jabber-roster-sexp-to-xml union t ("to" "both") ("from" "both") ("to" "both") ("from" "both") #[(type) "\303\304\305 B\302\nBDD\"\207" [jabber-buffer-connection jid type jabber-send-sexp presence to] 6] request-subscription #[nil "\301M\207" [#1=#:old request-subscription] 2] "subscribe" "unsubscribe" "unsubscribed" jabber-send-iq "set" query ((xmlns . "jabber:iq:roster")) jabber-report-success "Roster import" --dolist-tail-- jid jid-symbol in-roster-p jid-name jid-subscription jid-groups jabber-import-subscription-p-widget have-from have-to want-from want-to #2=#:vnew #1#] 10 (#$ . 3681)]) #@150 Convert ROSTER to simpler sexp format. Return a list, where each item is a vector: [jid name subscription groups] where groups is a list of strings. (defalias 'jabber-roster-to-sexp #[(roster) "\301\302\"\207" [roster mapcar #[(n) "\301!\302N\206\n\303\304N\305NF\207" [n symbol-name name "" subscription groups] 5]] 3 (#$ . 5208)]) #@49 Convert SEXP to XML format. Return an XML node. (defalias 'jabber-roster-sexp-to-xml #[(sexp &optional omit-subscription) "\303\304@B\305A@\211G\306U?\205\301 BC)\n?\205\"\307\3108BC\"B\311\312\3138\"BB\207" [sexp name omit-subscription item jid append 0 subscription 2 mapcar #[(g) "\301\302E\207" [g group nil] 3] 3] 8 (#$ . 5553)]) #@176 Convert XML-DATA to simpler sexp format. XML-DATA is an node with a child. See `jabber-roster-to-sexp' for description of output format. (defalias 'jabber-roster-xml-to-sexp #[(xml-data) "\211<\205 @)\303=\204\304\305!\210\306\302\"@\211\204!\304\302!\210\307\310\306\n\311\"\")\207" [xml-data node query iq cl--assertion-failed (eq (jabber-xml-node-name xml-data) 'iq) jabber-xml-get-children mapcar #[(n) "\303\211:\205 \304\n \"*\305\211:\205\304\n \"*\206 \306\307\211:\205-\304\n \"*\310\311\312\313\"\"F\207" [n attribute node jid xml-get-attribute-or-nil name #1="" subscription mapcar #[(g) "\211AA\211\303\232?\205\n*@\207" [g node children ((#1#))] 3] jabber-xml-get-children group] 9] item] 6 (#$ . 5904)]) (defalias 'jabber-export-display #[(roster) "\302\303\304#\211\207" [roster jabber-export-roster-widget widget-create (repeat :tag "Roster" (list :format "%v" (string :tag "JID") (string :tag "Name") (choice :tag "Subscription" (const "none") (const "both") (const "to") (const "from")) (repeat :tag "Groups" (string :tag "Group")))) :value] 4]) (provide 'jabber-export)