]>
Commit | Line | Data |
---|---|---|
53e6db90 DC |
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\300\304!\207" [require jabber-core jabber-widget jabber-iq jabber-avatar] 2) | |
9 | #@62 The avatar structure for the photo in the vCard edit buffer.\1f | |
10 | (defvar jabber-vcard-photo nil (#$ . 213)) | |
11 | (make-variable-buffer-local 'jabber-vcard-photo) | |
12 | #@100 Parse the vCard XML structure given in VCARD. | |
13 | The top node should be the `vCard' node. | |
14 | ||
15 | (fn VCARD)\1f | |
16 | (defalias 'jabber-vcard-parse #[257 "\300\301\211\203E\0\211@\302\ 4\ 2\"@\211\211AA\211\303\232?\205\19\0\211\266\202@\203=\0\211\211<\205'\0\211@\262\ 1\ 1\211AA\211\303\232?\2055\0\211\266\202@B\ 4B\262\ 4\210\ 1A\266\202\202\ 2\0\210\302\ 2\304\"@\304\300\ 2\211AA\211\303\232?\205Y\0\211\266\202\211\203\252\0\211@\211\211<\205i\0\211@\262\ 1\305>\203\243\0\211\211AA\211\303\232?\205|\0\211\266\202@G\306U\204\243\0\211\211<\205\215\0\211@\262\ 1\ 1\211AA\211\303\232?\205\233\0\211\266\202@B\ 3B\262\ 3\ 1A\266\202\202[\0\210\211\262\ 1B\ 2B\266\202\300\302\ 3\307\"\211\203I\ 1\211@\300\310\211\203\331\0\211@\302\ 4\ 2\"\203\322\0\211\ 3B\262\ 3\ 1A\266\202\202\300\0\210\300\ 2\211AA\211\303\232?\205\347\0\211\266\202\211\2038\ 1\211@\211\211<\205\367\0\211@\262\ 1\311>\2031\ 1\211\211AA\211\303\232?\205\n\ 1\211\266\202@G\306U\2041\ 1\211\211<\205\e\ 1\211@\262\ 1\ 1\211AA\211\303\232?\205)\ 1\211\266\202@B\ 3B\262\ 3\ 1A\266\202\202\351\0\210\ 1\ 1B\ 5B\262\ 5\266\ 2\ 1A\266\202\202\270\0\210\211\203U\ 1\307\ 1B\ 2B\262\ 2\210\300\302\ 3\312\"\211\203\244\ 1\211@\302\ 1\313\"@\211AA\211\303\232?\205q\ 1\211\266\202@\300\ 1\203\233\ 1\314\211\203\223\ 1\211@\302\ 5\ 2\"\203\214\ 1\211\ 3B\262\ 3\ 1A\266\202\202z\ 1\210\211\ 2B\ 5B\262\ 5\266\ 2\ 1A\266\202\202[\ 1\210\211\203\260\ 1\312\ 1B\ 2B\262\ 2\210\300\302\ 3\315\"\211\203\10\ 2\211@\302\ 1\316\"@\211AA\211\303\232?\205\314\ 1\211\266\202@\300\ 1\203\a\ 2\317\211\203\356\ 1\211@\302\ 5\ 2\"\203\347\ 1\211\ 3B\262\ 3\ 1A\266\202\202\325\ 1\210\320\ 1>\204\0\ 2\321\ 1>\204\0\ 2\320\ 1B\262\ 1\211\ 2B\ 5B\262\ 5\266\ 2\ 1A\266\202\202\266\ 1\210\211\203\1c\ 2\315\ 1B\ 2B\262\ 2\210\302\ 2\322\"@\211\203@\ 2\323\ 1\324\"\323\ 2\325\"\ 1\203>\ 2\211\203>\ 2\322\ 2\ 2E\ 4B\262\ 4\266\ 2\210\207" [nil (FN NICKNAME BDAY JABBERID MAILER TZ TITLE ROLE NOTE PRODID REV SORT-STRING UID URL DESC) jabber-xml-get-children ((#1="")) N (FAMILY GIVEN MIDDLE PREFIX SUFFIX) 0 ADR (HOME WORK POSTAL PARCEL DOM INTL PREF) (POBOX EXTADD STREET LOCALITY REGION PCODE CTRY) TEL NUMBER (HOME WORK VOICE FAX PAGER MSG CELL VIDEO BBS MODEM ISDN PCS PREF) EMAIL USERID (HOME WORK INTERNET PREF X400) INTERNET X400 PHOTO jabber-xml-path (TYPE #1#) (BINVAL #1#)] 14 (#$ . 373)]) | |
17 | #@56 Create a vCard XML structure from PARSED. | |
18 | ||
19 | (fn PARSED)\1f | |
20 | (defalias 'jabber-vcard-reassemble #[257 "\302\ 1\236A\211\204\ e\0\303\10\210\2027\0\211<\203\1f\0\304\ 1A@\ 2@\"\10\210\2027\0\305\ 1\306\"\210\307\310\ 2!8\311V\2032\0\312\313!\210\314\ 1!\10\210\315\316\317\320\321\ 5\"\322\303\320\323\322\ 6 \236A\"BBC\320\324\325\ 6\b\236A\"\320\326\327\ 6 \236A\"\320\330\331\ 6\n\236A\"\b\205\225\0\302\303\332\303\333\b! >\204z\0\334\335\336\bD\"\210\b\337HE\340\303\333\b! >\204\217\0\334\335\336\bD\"\210\b\341HEFC&\ 6BB\207" [jabber-vcard-photo cl-struct-avatar-tags PHOTO nil jabber-avatar-from-base64-string access-file "Avatar file not found" 7 file-attributes 8192 error "Avatar bigger than 8 kilobytes" jabber-avatar-from-file vCard ((xmlns . "vcard-temp")) append mapcar #[257 "\211@\b\236\205\16\0\211AG\301U?\205\16\0\211@\302\ 2AE\207" [jabber-vcard-fields 0 nil] 4 "\n\n(fn FIELD)"] N #[257 "\211AG\300U?\205\ f\0\211@\301\ 2AE\207" [0 nil] 4 "\n\n(fn NAME-PART)"] #[257 "\300\301\302\303\304\ 5@\"\303\305\ 6\ 6A\"$\207" [append (ADR) (nil) mapcar list #[257 "\211@\300\ 2AE\207" [nil] 4 "\n\n(fn FIELD)"]] 8 "\n\n(fn ADDRESS)"] ADR #[257 "\300\301\302\303\304\ 5@\"\305\306\ 6\ 6AEC$\207" [append (TEL) (nil) mapcar list NUMBER nil] 8 "\n\n(fn PHONE)"] TEL #[257 "\300\301\302\303\304\ 5@\"\305\306\ 6\ 6AEC$\207" [append (EMAIL) (nil) mapcar list USERID nil] 8 "\n\n(fn EMAIL)"] EMAIL TYPE type-of signal wrong-type-argument avatar 2 BINVAL 4] 18 (#$ . 2458)]) | |
21 | (byte-code "\300\301\302\303B\"\207" [add-to-list jabber-jid-info-menu "Request vcard" jabber-vcard-get] 4) | |
22 | #@68 Request vcard from JID. | |
23 | ||
24 | JC is the Jabber connection. | |
25 | ||
26 | (fn JC JID)\1f | |
27 | (defalias 'jabber-vcard-get #[514 "\300\ 2\ 2\301\302\303\304\303\305&\b\207" [jabber-send-iq "get" (vCard ((xmlns . "vcard-temp"))) jabber-process-data jabber-vcard-display "Vcard request failed"] 11 (#$ . 3963) (byte-code "\300 \301\302\303\211\211\304%D\207" [jabber-read-account jabber-read-jid-completing "Request vcard from: " nil bare-or-muc] 7)]) | |
28 | #@61 Edit your own vcard. | |
29 | ||
30 | JC is the Jabber connection. | |
31 | ||
32 | (fn JC)\1f | |
33 | (defalias 'jabber-vcard-edit #[257 "\300\ 1\301\302\303\304\301\305\306&\b\207" [jabber-send-iq nil "get" (vCard ((xmlns . "vcard-temp"))) jabber-vcard-do-edit jabber-report-success "Vcard request failed"] 10 (#$ . 4386) (byte-code "\300 C\207" [jabber-read-account] 1)]) | |
34 | (defconst jabber-vcard-fields '((FN . "Full name") (NICKNAME . "Nickname") (BDAY . "Birthday") (URL . "URL") (JABBERID . "JID") (MAILER . "User agent") (TZ . "Time zone") (TITLE . "Title") (ROLE . "Role") (REV . "Last changed") (DESC . "Description") (NOTE . "Note"))) | |
35 | (defconst jabber-vcard-name-fields '((PREFIX . "Prefix") (GIVEN . "Given name") (MIDDLE . "Middle name") (FAMILY . "Family name") (SUFFIX . "Suffix"))) | |
36 | (defconst jabber-vcard-phone-types '((HOME . "Home") (WORK . "Work") (VOICE . "Voice") (FAX . "Fax") (PAGER . "Pager") (MSG . "Message") (CELL . "Cell phone") (VIDEO . "Video") (BBS . "BBS") (MODEM . "Modem") (ISDN . "ISDN") (PCS . "PCS"))) | |
37 | (defconst jabber-vcard-email-types '((HOME . "Home") (WORK . "Work") (INTERNET . "Internet") (X400 . "X400") (PREF . "Preferred"))) | |
38 | (defconst jabber-vcard-address-types '((HOME . "Home") (WORK . "Work") (POSTAL . "Postal") (PARCEL . "Parcel") (DOM . "Domestic") (INTL . "International") (PREF . "Preferred"))) | |
39 | (defconst jabber-vcard-address-fields '((POBOX . "Post box") (EXTADD . "Ext. address") (STREET . "Street") (LOCALITY . "Locality") (REGION . "Region") (PCODE . "Post code") (CTRY . "Country"))) | |
40 | #@166 Display received vcard. | |
41 | ||
42 | JC is the Jabber connection. | |
43 | XML-DATA is the parsed tree data from the stream (stanzas) | |
44 | obtained from `xml-parse-region'. | |
45 | ||
46 | (fn JC XML-DATA)\1f | |
47 | (defalias 'jabber-vcard-display #[514 "\303\304\ 2!!\b\211\203)\0\211@\211@\ 3\236\211\203!\0\ 1Ac\210\305j\210\211A\306\261\ 2\210\210\ 1A\266\202\202\ 6\0\210\307\ 1\236A\211\203Z\0\306c\210 \211\203Y\0\211@\211@\ 3\236\211\203Q\0\ 1Ac\210\305j\210\211A\306\261\ 2\210\210\ 1A\266\202\2026\0\210\210\310\ 1\236A\211\203\213\0\306c\210\311\312\313\314#c\210\211\211\203\212\0\211@\315\316\ 2@\317#c\210\320\ 1A\306\261\ 3\210\ 1A\266\202\202n\0\210\210\321\ 1\236A\211\203\274\0\306c\210\311\322\313\314#c\210\211\211\203\273\0\211@\315\323\ 2@\317#c\210\320\ 1A\306\261\ 3\210\ 1A\266\202\202\237\0\210\210\324\ 1\236A\211\203\12\ 1\306c\210\311\325\313\314#c\210\211\211\203\11\ 1\211@\311\315\326\ 3@\317#\313\327#c\210\306c\210\n\211\203 \ 1\211@\211@\ 3\236\211\203\ 1\ 1\ 1Ac\210\305j\210\211A\306\261\ 2\210\210\ 1A\266\202\202\346\0\210\ 1A\266\202\202\320\0\210\210\330\ 1\236A@\331\330\ 3\2368\ 1\205>\ 1\211\205>\ 1\3321;\ 1\333\334\ 2!\335\336#\337\ 1\340\"\210\306c\262\ 10\207\210\341c\207" [jabber-vcard-fields jabber-vcard-name-fields jabber-vcard-address-fields jabber-vcard-parse jabber-iq-query 20 "\n" N EMAIL jabber-propertize "E-mail addresses:\n" face jabber-title-medium mapconcat #[257 "\211\b\236A\207" [jabber-vcard-email-types] 3 "\n\n(fn TYPE)"] " " ": " TEL "Phone numbers:\n" #[257 "\211\b\236A\207" [jabber-vcard-phone-types] 3 "\n\n(fn TYPE)"] ADR "Addresses:\n" #[257 "\211\b\236A\207" [jabber-vcard-address-types] 3 "\n\n(fn TYPE)"] jabber-title-small PHOTO 2 (error) jabber-create-image base64-decode-string nil t insert-image "[Photo]" "Couldn't display photo\n"] 11 (#$ . 5888)]) | |
48 | #@33 | |
49 | ||
50 | (fn JC XML-DATA CLOSURE-DATA)\1f | |
51 | (defalias 'jabber-vcard-do-edit #[771 "\303\304\ 3!!\305r\306\307!q\210\310\305!\210\ 4\10`\262\ 1 \211\203?\0\211@\311\ 1A!\210\312j\210\211@\ 4\236A\ 1@\313\314\ 3\2062\0\315\"B\nB\12\210\ 1A\266\202\202\16\0\210\311\316!\210\317\313\320\321\317\ 6\ 6\236A#B\nB\12\311\316!\210\322\313\323\321\322\ 6\ 6\236A#B\nB\12\311\316!\210\324\313\325\321\324\ 6\ 6\236A#B\nB\12\311\316!\210\326\313\327\321\326\ 6\ 6\236A#B\nB\12\311\316!\210\311\330!\210\331\ 2\236\211\205\237\0\332\333\ 28\ 2A@\"\331\313\334\335\336\ 6\ 6\205\272\0\337\340\341\342\343\344\345\ 6\f!#P\ 6 AFC\346\"BB\321\ 5A#B\nB\12\266\ 2\311\316!\210\313\347\350\351\352$\210\353 \210\354\355!\210\356p!\210\211b)\207" [jabber-buffer-connection jabber-vcard-fields jabber-widget-alist jabber-vcard-parse jabber-iq-query nil get-buffer-create "Edit vcard" jabber-init-widget-buffer widget-insert 15 widget-create editable-field #1="" "\n" N (set :tag "Decomposited name" (cons :tag "Prefix" :format "%t: %v" (const :format #1# PREFIX) (string :format "%v")) (cons :tag "Given name" :format "%t: %v" (const :format #1# GIVEN) (string :format "%v")) (cons :tag "Middle name" :format "%t: %v" (const :format #1# MIDDLE) (string :format "%v")) (cons :tag "Family name" :format "%t: %v" (const :format #1# FAMILY) (string :format "%v")) (cons :tag "Suffix" :format "%t: %v" (const :format #1# SUFFIX) (string :format "%v"))) :value ADR (repeat :tag "Postal addresses" (cons :tag "Address" (set :tag "Type" (const :tag "Home" HOME) (const :tag "Work" WORK) (const :tag "Postal" POSTAL) (const :tag "Parcel" PARCEL) (const :tag "Domestic" DOM) (const :tag "International" INTL) (const :tag "Preferred" PREF)) (set :tag "Address" (cons :tag "Post box" :format "%t: %v" (const :format #1# POBOX) (string :format "%v")) (cons :tag "Ext. address" :format "%t: %v" (const :format #1# EXTADD) (string :format "%v")) (cons :tag "Street" :format "%t: %v" (const :format #1# STREET) (string :format "%v")) (cons :tag "Locality" :format "%t: %v" (const :format #1# LOCALITY) (string :format "%v")) (cons :tag "Region" :format "%t: %v" (const :format #1# REGION) (string :format "%v")) (cons :tag "Post code" :format "%t: %v" (const :format #1# PCODE) (string :format "%v")) (cons :tag "Country" :format "%t: %v" (const :format #1# CTRY) (string :format "%v"))))) TEL (repeat :tag "Phone numbers" (cons :tag "Number" (set :tag "Type" (const :tag "Home" HOME) (const :tag "Work" WORK) (const :tag "Voice" VOICE) (const :tag "Fax" FAX) (const :tag "Pager" PAGER) (const :tag "Message" MSG) (const :tag "Cell phone" CELL) (const :tag "Video" VIDEO) (const :tag "BBS" BBS) (const :tag "Modem" MODEM) (const :tag "ISDN" ISDN) (const :tag "PCS" PCS)) (string :tag "Number"))) EMAIL (repeat :tag "E-mail addresses" (cons :tag "Address" (set :tag "Type" (const :tag "Home" HOME) (const :tag "Work" WORK) (const :tag "Internet" INTERNET) (const :tag "X400" X400) (const :tag "Preferred" PREF)) (string :tag "Address"))) "Photo/avatar:\n" PHOTO jabber-avatar-from-base64-string 2 radio-button-choice (const :tag "None" nil) append const :tag "Existing: " jabber-propertize " " display jabber-avatar-image ((file :must-match t :tag "From file")) push-button :notify jabber-vcard-submit "Submit" widget-setup widget-minor-mode 1 switch-to-buffer] 20 (#$ . 7571)]) | |
52 | #@21 | |
53 | ||
54 | (fn &rest IGNORE)\1f | |
55 | (defalias 'jabber-vcard-submit #[128 "\305\306\307\b\"!\310 \311\312\ 4\313\314\313\314&\b\210\315\302!\2055\0\n\2055\0\316 \v\2054\0\317\v!\f>\2041\0\320\321\322\vD\"\210\v\323H\"\207" [jabber-widget-alist jabber-buffer-connection jabber-vcard-avatars-publish jabber-vcard-photo cl-struct-avatar-tags jabber-vcard-reassemble mapcar #[257 "\211@\300\ 2A!B\207" [widget-value] 4 "\n\n(fn ENTRY)"] jabber-send-iq nil "set" jabber-report-success "Changing vCard" boundp jabber-vcard-avatars-update-current type-of signal wrong-type-argument avatar 1] 11 (#$ . 10836)]) | |
56 | (provide 'jabber-vcard) |