;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\302\303\304\305\306\307%\210\310\311\312\313\306\303\314\315&\210\310\316\304\317\306\303\314\320&\210\310\321\322\323\306\303\314\324&\210\310\325\322\326\306\303\314\324&\207" [require mailcap custom-declare-group jabber-avatar nil "Avatar related settings" :group jabber custom-declare-variable jabber-avatar-cache-directory (locate-user-emacs-file "jabber-avatar-cache" ".jabber-avatars") "Directory to use for cached avatars" :type directory jabber-avatar-verbose "Display messages about irregularities with other people's avatars." boolean jabber-avatar-max-width 96 "Maximum width of avatars." integer jabber-avatar-max-height "Maximum height of avatars."] 8) #@41 compiler-macro for inlining `avatar-p'. (defalias 'avatar-p--cmacro #[(_cl-whole-arg cl-x) "\301\302\303\304\211\211&\207" [cl-x cl--defsubst-expand (cl-x) (cl-block avatar-p (and (memq (type-of cl-x) cl-struct-avatar-tags) t)) nil] 7 (#$ . 784)]) (put 'avatar-p 'compiler-macro 'avatar-p--cmacro) (defalias 'avatar-p #[(cl-x) "\302! >\205 \303\207" [cl-x cl-struct-avatar-tags type-of t] 2]) (byte-code "\300\301\302\303#\304\305\306\301#\207" [function-put avatar-p side-effect-free error-free put avatar cl-deftype-satisfies] 5) #@48 compiler-macro for inlining `avatar-sha1-sum'. (defalias 'avatar-sha1-sum--cmacro #[(_cl-whole-arg cl-x) "\301\302\303\304\211\211&\207" [cl-x cl--defsubst-expand (cl-x) (cl-block avatar-sha1-sum (progn (or (avatar-p cl-x) (signal 'wrong-type-argument (list 'avatar cl-x))) (aref cl-x 1))) nil] 7 (#$ . 1326)]) (put 'avatar-sha1-sum 'compiler-macro 'avatar-sha1-sum--cmacro) #@49 Access slot "sha1-sum" of `avatar' struct CL-X. (defalias 'avatar-sha1-sum #[(cl-x) "\302! >\204\303\304\305D\"\210\306H\207" [cl-x cl-struct-avatar-tags type-of signal wrong-type-argument avatar 1] 4 (#$ . 1709)]) (byte-code "\300\301\302\303#\300\207" [function-put avatar-sha1-sum side-effect-free t] 4) #@49 compiler-macro for inlining `avatar-mime-type'. (defalias 'avatar-mime-type--cmacro #[(_cl-whole-arg cl-x) "\301\302\303\304\211\211&\207" [cl-x cl--defsubst-expand (cl-x) (cl-block avatar-mime-type (progn (or (avatar-p cl-x) (signal 'wrong-type-argument (list 'avatar cl-x))) (aref cl-x 2))) nil] 7 (#$ . 2027)]) (put 'avatar-mime-type 'compiler-macro 'avatar-mime-type--cmacro) #@50 Access slot "mime-type" of `avatar' struct CL-X. (defalias 'avatar-mime-type #[(cl-x) "\302! >\204\303\304\305D\"\210\306H\207" [cl-x cl-struct-avatar-tags type-of signal wrong-type-argument avatar 2] 4 (#$ . 2415)]) (byte-code "\300\301\302\303#\300\207" [function-put avatar-mime-type side-effect-free t] 4) #@43 compiler-macro for inlining `avatar-url'. (defalias 'avatar-url--cmacro #[(_cl-whole-arg cl-x) "\301\302\303\304\211\211&\207" [cl-x cl--defsubst-expand (cl-x) (cl-block avatar-url (progn (or (avatar-p cl-x) (signal 'wrong-type-argument (list 'avatar cl-x))) (aref cl-x 3))) nil] 7 (#$ . 2736)]) (put 'avatar-url 'compiler-macro 'avatar-url--cmacro) #@44 Access slot "url" of `avatar' struct CL-X. (defalias 'avatar-url #[(cl-x) "\302! >\204\303\304\305D\"\210\306H\207" [cl-x cl-struct-avatar-tags type-of signal wrong-type-argument avatar 3] 4 (#$ . 3094)]) (byte-code "\300\301\302\303#\300\207" [function-put avatar-url side-effect-free t] 4) #@51 compiler-macro for inlining `avatar-base64-data'. (defalias 'avatar-base64-data--cmacro #[(_cl-whole-arg cl-x) "\301\302\303\304\211\211&\207" [cl-x cl--defsubst-expand (cl-x) (cl-block avatar-base64-data (progn (or (avatar-p cl-x) (signal 'wrong-type-argument (list 'avatar cl-x))) (aref cl-x 4))) nil] 7 (#$ . 3397)]) (put 'avatar-base64-data 'compiler-macro 'avatar-base64-data--cmacro) #@52 Access slot "base64-data" of `avatar' struct CL-X. (defalias 'avatar-base64-data #[(cl-x) "\302! >\204\303\304\305D\"\210\306H\207" [cl-x cl-struct-avatar-tags type-of signal wrong-type-argument avatar 4] 4 (#$ . 3795)]) (byte-code "\300\301\302\303#\300\207" [function-put avatar-base64-data side-effect-free t] 4) #@46 compiler-macro for inlining `avatar-height'. (defalias 'avatar-height--cmacro #[(_cl-whole-arg cl-x) "\301\302\303\304\211\211&\207" [cl-x cl--defsubst-expand (cl-x) (cl-block avatar-height (progn (or (avatar-p cl-x) (signal 'wrong-type-argument (list 'avatar cl-x))) (aref cl-x 5))) nil] 7 (#$ . 4122)]) (put 'avatar-height 'compiler-macro 'avatar-height--cmacro) #@47 Access slot "height" of `avatar' struct CL-X. (defalias 'avatar-height #[(cl-x) "\302! >\204\303\304\305D\"\210\306H\207" [cl-x cl-struct-avatar-tags type-of signal wrong-type-argument avatar 5] 4 (#$ . 4495)]) (byte-code "\300\301\302\303#\300\207" [function-put avatar-height side-effect-free t] 4) #@45 compiler-macro for inlining `avatar-width'. (defalias 'avatar-width--cmacro #[(_cl-whole-arg cl-x) "\301\302\303\304\211\211&\207" [cl-x cl--defsubst-expand (cl-x) (cl-block avatar-width (progn (or (avatar-p cl-x) (signal 'wrong-type-argument (list 'avatar cl-x))) (aref cl-x 6))) nil] 7 (#$ . 4807)]) (put 'avatar-width 'compiler-macro 'avatar-width--cmacro) #@46 Access slot "width" of `avatar' struct CL-X. (defalias 'avatar-width #[(cl-x) "\302! >\204\303\304\305D\"\210\306H\207" [cl-x cl-struct-avatar-tags type-of signal wrong-type-argument avatar 6] 4 (#$ . 5175)]) (byte-code "\300\301\302\303#\300\207" [function-put avatar-width side-effect-free t] 4) #@45 compiler-macro for inlining `avatar-bytes'. (defalias 'avatar-bytes--cmacro #[(_cl-whole-arg cl-x) "\301\302\303\304\211\211&\207" [cl-x cl--defsubst-expand (cl-x) (cl-block avatar-bytes (progn (or (avatar-p cl-x) (signal 'wrong-type-argument (list 'avatar cl-x))) (aref cl-x 7))) nil] 7 (#$ . 5484)]) (put 'avatar-bytes 'compiler-macro 'avatar-bytes--cmacro) #@46 Access slot "bytes" of `avatar' struct CL-X. (defalias 'avatar-bytes #[(cl-x) "\302! >\204\303\304\305D\"\210\306H\207" [cl-x cl-struct-avatar-tags type-of signal wrong-type-argument avatar 7] 4 (#$ . 5852)]) (byte-code "\300\301\302\303#\304\305\306\"\207" [function-put avatar-bytes side-effect-free t defalias copy-avatar copy-sequence] 4) #@128 compiler-macro for inlining `make-avatar'. (fn CL-WHOLE &cl-quote &key SHA1-SUM MIME-TYPE URL BASE64-DATA HEIGHT WIDTH BYTES) (defalias 'make-avatar--cmacro #[(cl-whole &rest #1=#:--cl-rest--) "\306\307\"A@\306\310\"A@\306\311\"A@\306\312\"A@\306\313\"A@\306\314\"A@\306\315\"A@\203f@\316>\203MAA\211\2028\317>A@\203\\\320\211\2028\321\322@\"\210\2026)\323\324\325\320\320 \n \f &\f.\207" [#1# sha1-sum mime-type url base64-data height plist-member :sha1-sum :mime-type :url :base64-data :height :width :bytes (:sha1-sum :mime-type :url :base64-data :height :width :bytes :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:sha1-sum :mime-type :url :base64-data :height :width :bytes)" cl--defsubst-expand (sha1-sum mime-type url base64-data height width bytes) (cl-block make-avatar (record 'avatar sha1-sum mime-type url base64-data height width bytes)) width bytes #2=#:--cl-keys-- cl-whole] 14 (#$ . 6207)]) (put 'make-avatar 'compiler-macro 'make-avatar--cmacro) #@108 Constructor for objects of type `avatar'. (fn &key SHA1-SUM MIME-TYPE URL BASE64-DATA HEIGHT WIDTH BYTES) (defalias 'make-avatar #[(&rest #1=#:--cl-rest--) "\306\307\"A@\306\310\"A@\306\311\"A@\306\312\"A@\306\313\"A@\306\314\"A@\306\315\"A@\203f@\316>\203MAA\211\2028\317>A@\203\\\320\211\2028\321\322@\"\210\2026)\323\324 \n \f &.\207" [#1# sha1-sum mime-type url base64-data height plist-member :sha1-sum :mime-type :url :base64-data :height :width :bytes (:sha1-sum :mime-type :url :base64-data :height :width :bytes :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:sha1-sum :mime-type :url :base64-data :height :width :bytes)" record avatar width bytes #2=#:--cl-keys--] 10 (#$ . 7257)]) (byte-code "\300\301\302\303#\304\305\306\307\310\306\311\312\305\303& \207" [function-put make-avatar side-effect-free t cl-struct-define avatar nil cl-structure-object record ((cl-tag-slot) (sha1-sum) (mime-type) (url) (base64-data) (height) (width) (bytes)) cl-struct-avatar-tags] 11) #@94 Construct an avatar structure from the given URL. Retrieves the image to find info about it. (defalias 'jabber-avatar-from-url #[(url) "r\305\306 !)q\210\307\3101\311\312!\210\313\314!0\202\210\315\316\317!\210`d{\320\f\315 #\321\315!\210,\207" [coding-system-for-read url case-fold-search mime-type data binary url-retrieve-synchronously t (error) search-forward-regexp "^content-type:[ ]*\\(.*\\)$" match-string 1 nil search-forward "\n\n" jabber-avatar-from-data kill-buffer] 4 (#$ . 8321)]) #@46 Construct an avatar structure from FILENAME. (defalias 'jabber-avatar-from-file #[(filename) "\304\305!\210\306\307\310\"rq\210\311\216\312 !\210\313 +\314\315 \"\205#\316\317\320 \"!\321 \322\n#*\207" [#1=#:temp-buffer filename mime-type data require mailcap generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] insert-file-contents-literally buffer-string string-match "\\.[^.]+$" mailcap-extension-to-mime match-string 0 jabber-avatar-from-data nil] 5 (#$ . 8831)]) #@117 Construct an avatar stucture from BASE64-STRING. If MIME-TYPE is not specified, try to find it from the image data. (defalias 'jabber-avatar-from-base64-string #[(base64-string &optional mime-type) "\302\303 #\207" [base64-string mime-type jabber-avatar-from-data nil] 4 (#$ . 9355)]) #@177 Construct an avatar structure from RAW-DATA and/or BASE64-STRING. If either is not provided, it is computed. If MIME-TYPE is not specified, try to find it from the image data. (defalias 'jabber-avatar-from-data #[(raw-data base64-string &optional mime-type) "\206\306 !\211G\307\n! \206\310!\2061\311\3121*\313\n\314\315#0\202,\210\314AN\316\236A\317\320\321\f\314 \314\211 &!-\207" [raw-data base64-string data bytes sha1-sum base64-data base64-decode-string sha1 base64-encode-string :type (error) jabber-create-image nil t ((png "image/png") (jpeg "image/jpeg") (gif "image/gif")) jabber-avatar-compute-size record avatar mime-type type] 11 (#$ . 9648)]) #@83 Create an image from AVATAR. Return nil if images of this type are not supported. (defalias 'jabber-avatar-image #[(avatar) "\30315\304\305\306\307\"rq\210\310\216\311\312!\210\313 !\n>\204#\314\315\301 D\"\210 \316Hc\210\317ed\"\210\320 +\312\307#0\207\210\312\207" [#1=#:temp-buffer avatar cl-struct-avatar-tags (error) jabber-create-image generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] set-buffer-multibyte nil type-of signal wrong-type-argument 4 base64-decode-region buffer-string] 5 (#$ . 10332)]) #@71 Compute and set the width and height fields of AVATAR. Return AVATAR. (defalias 'jabber-avatar-compute-size #[(avatar) "\306\307!\205\307 \205\310!\211\205\311 \312\")\211\203M\313! >\204,\314\315\300D\"\210\211\316\n@I\210)\313! >\204D\314\315\300D\"\210\211\317\nAI\210))\207" [avatar image size cl-struct-avatar-tags #1=#:v #2=#:v fboundp display-graphic-p jabber-avatar-image image-size t type-of signal wrong-type-argument 6 5] 5 (#$ . 10895)]) #@110 Return file name of cached image for avatar identified by SHA1-SUM. If there is no cached image, return nil. (defalias 'jabber-avatar-find-cached #[(sha1-sum) "\303 \"\304\n!\205\f\n)\207" [sha1-sum jabber-avatar-cache-directory filename expand-file-name file-exists-p] 3 (#$ . 11373)]) #@19 Cache the AVATAR. (defalias 'jabber-avatar-cache #[(avatar) "\306! >\204\307\310\300D\"\210\311H\306! >\204\"\307\310\300D\"\210\312H\306! >\2045\307\310\300D\"\210\313H\314\n \"\315 !\204J\316 \317\"\210\320!\203^\205\214\321\322\"\202\214\323\324\317\"rq\210\325\216\326\327 !\330\331!\203{\331\326!\210 c\210\332ed\"\210\333ed\326\334%-,\207" [avatar cl-struct-avatar-tags id base64-data mime-type jabber-avatar-cache-directory type-of signal wrong-type-argument 1 4 2 expand-file-name file-directory-p make-directory t file-exists-p message "Caching avatar, but %s already exists" generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1=#:temp-buffer buffer-name kill-buffer] 2] nil binary fboundp set-buffer-multibyte base64-decode-region write-region silent filename jabber-avatar-verbose #1# coding-system-for-write require-final-newline] 6 (#$ . 11669)]) #@182 Set the avatar of JID to be AVATAR. JID is a string containing a bare JID. AVATAR may be one of: * An avatar structure. * The SHA1 sum of a cached avatar. * nil, meaning no avatar. (defalias 'jabber-avatar-set #[(jid avatar) "\306!\307\211\310\f! >\203(\310\f! >\204\311\312\304\fD\"\210\f\313H\314\2028\f;\2034\f\315\2028\307\316 \317N\230?\205Q\320 \304\n #\210\320 \317 #\210\321 !+\207" [jid hash image jid-symbol avatar cl-struct-avatar-tags jabber-jid-symbol nil type-of signal wrong-type-argument 1 #[nil "\301!\207" [avatar jabber-avatar-image] 2] #[nil "\3011 \302\303!!0\207\210\304\207" [avatar (error) jabber-create-image jabber-avatar-find-cached nil] 3] ignore avatar-hash put jabber-presence-update-roster] 4 (#$ . 12585)]) #@133 Create image, scaled down to jabber-avatar-max-width/height, if width/height exceeds either of those, and ImageMagick is available. (defalias 'jabber-create-image #[(file-or-data &optional type data-p) "\306 \n#\307 \310\" A\311\312!\2038\f@V\204$\fAV\2038\313 \314\315#\210\313 \316#\210\313 \317#\210 +\207" [file-or-data type data-p image size spec create-image image-size t functionp imagemagick-types plist-put :type imagemagick :width :height jabber-avatar-max-width jabber-avatar-max-height] 4 (#$ . 13352)]) (provide 'jabber-avatar)