;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\302\303\304\305\306\301\307\310&\210\302\311\312\313\306\301\307\310&\207" [require jabber-avatar custom-declare-variable jabber-vcard-avatars-retrieve (and (fboundp 'display-images-p) (display-images-p)) "Automatically download vCard avatars?" :group :type boolean jabber-vcard-avatars-publish t "Publish your vCard photo as avatar?"] 8) #@71 For each connection, SHA1 hash of current avatar. Keys are full JIDs. (defvar jabber-vcard-avatars-current-hash (make-hash-table :test 'equal) (#$ . 454)) (add-to-list 'jabber-presence-chain 'jabber-vcard-avatars-presence) #@51 Look for vCard avatar mark in stanza. (defalias 'jabber-vcard-avatars-presence #[(jc xml-data) "\205m \306\211:\205\307 \n\"*?\205m\310 \304\211:\205$\307 \n\"*!\311 \312\"\211\211AA\211\313\232?\205<*@\211\204K\314\f\315\"\202l\316\f!\317N\230\206l\320!\203e\314\f\"\202l\321\f#+\207" [jabber-vcard-avatars-retrieve xml-data attribute node from photo type xml-get-attribute-or-nil jabber-jid-user jabber-xml-path (("vcard-temp:x:update" . "x") photo) (("")) jabber-avatar-set nil jabber-jid-symbol avatar-hash jabber-avatar-find-cached jabber-vcard-avatars-fetch children sha1-hash jc] 5 (#$ . 683)]) #@40 Fetch WHO's vCard, and extract avatar. (defalias 'jabber-vcard-avatars-fetch #[(jc who sha1-hash) "\303 \304\305\306 \nB\307\310&\207" [jc who sha1-hash jabber-send-iq "get" (vCard ((xmlns . "vcard-temp"))) jabber-vcard-avatars-vcard ignore nil] 9 (#$ . 1338) (list (jabber-read-account) (jabber-read-jid-completing "Fetch whose vCard avatar: ") nil)]) #@51 Get the photo from the vCard, and set the avatar. (defalias 'jabber-vcard-avatars-vcard #[(jc iq closure) "@A\306\307\310 !!\236\n\203c\311\312\n8\nA@\" \203W \313 !>\2040\314\315\305 D\"\210 \316H\230\204W\203W\317\320\321\f! \313 !>\204R\314\315\305 D\"\210 \316H$\210\322 !\210\323\f \")\202g\323\f\324\"+\207" [closure iq photo sha1-hash from avatar PHOTO jabber-vcard-parse jabber-iq-query jabber-avatar-from-base64-string 2 type-of signal wrong-type-argument 1 message "%s's avatar should have SHA1 sum %s, but has %s" jabber-jid-displayname jabber-avatar-cache jabber-avatar-set nil cl-struct-avatar-tags jabber-avatar-verbose] 8 (#$ . 1699)]) #@48 Request our own vCard, to find hash of avatar. (defalias 'jabber-vcard-avatars-find-current #[(jc) "\205\302 \303\304\305\306\307\306\303&\207" [jabber-vcard-avatars-publish jc jabber-send-iq nil "get" (vCard ((xmlns . "vcard-temp"))) jabber-vcard-avatars-find-current-1 t] 9 (#$ . 2375)]) (defalias 'jabber-vcard-avatars-find-current-1 #[(jc xml-data success) "\306 \205/\307\310\311\n!!\236\211\205.\312\313 8 A@\"\314\f! >\204*\315\316\304\fD\"\210\f\317H))\"\207" [jc success xml-data photo avatar cl-struct-avatar-tags jabber-vcard-avatars-update-current PHOTO jabber-vcard-parse jabber-iq-query jabber-avatar-from-base64-string 2 type-of signal wrong-type-argument 1] 7]) (defalias 'jabber-vcard-avatars-update-current #[(jc new-hash) "\304\305! \"\211 \230?\205\306\305! #\210\307!)\207" [jc jabber-vcard-avatars-current-hash old-hash new-hash gethash jabber-connection-bare-jid puthash jabber-send-current-presence] 5]) (byte-code "\301>\203 \210\202\301B\301\207" [jabber-presence-element-functions jabber-vcard-avatars-presence-element] 2) (defalias 'jabber-vcard-avatars-presence-element #[(jc) "\205\304\305 !\n\"\306\307 \205\310\311 EE)C\207" [jabber-vcard-avatars-publish jc jabber-vcard-avatars-current-hash hash gethash jabber-connection-bare-jid x ((xmlns . "vcard-temp:x:update")) photo nil] 5]) (provide 'jabber-vcard-avatars)