]>
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\303\304\305\306\307\310%\210\311\312\313\314\315DD\316\317\320\307\304&\a\210\311\321\313\314\322DD\323\317\320\307\304&\a\210\311\324\313\314\325DD\326\317\327\307\304&\a\210\311\330\313\314\331DD\332\317\333\307\304&\a\210\311\334\313\314\335DD\336\317\320\307\304&\a\210\311\337\313\314\340DD\341\317\320\307\304&\a\210\311\342\313\314\343DD\344\317\345\307\304&\a\207" [require jabber-core jabber-util custom-declare-group jabber-history nil "Customization options for Emacs\nJabber history files." :group jabber custom-declare-variable jabber-history-enabled funcall function #[0 "\300\207" [nil] 1 #1=""] "Non-nil means message logging is enabled." :type boolean jabber-history-muc-enabled #[0 "\300\207" [nil] 1 #1#] "Non-nil means MUC logging is enabled.\nDefault is nil, cause MUC logging may be i/o-intensive." jabber-history-dir #[0 "\300\301\302\"\207" [locate-user-emacs-file "jabber-history" ".emacs-jabber"] 3 #1#] "Base directory where per-contact history files are stored.\nUsed only when `jabber-use-global-history' is nil." directory jabber-global-history-filename #[0 "\300\301\302\"\207" [locate-user-emacs-file "jabber-global-message-log" ".jabber_global_message_log"] 3 #1#] "Global file where all messages are logged.\nUsed when `jabber-use-global-history' is non-nil." file jabber-use-global-history #[0 "\301\b!\207" [jabber-global-history-filename file-exists-p] 2 #1#] "Whether to use a global file for message history.\nIf non-nil, `jabber-global-history-filename' is used, otherwise,\nmessages are stored in per-user files under the\n`jabber-history-dir' directory." jabber-history-enable-rotation #[0 "\300\207" [nil] 1 #1#] "Whether to enable rotation of history files.\n\nIf nil, history files will grow indefinitely.\n\nIf non-nil, history files will be renamed to\n<history-file>-<number> (where <number> is 1 or the smallest\nnumber after the last rotation) when they reach\n`jabber-history-size-limit' kilobytes." jabber-history-size-limit #[0 "\300\207" [1024] 1 #1#] "Maximum history file size in kilobytes.\nWhen history file reaches this limit, it is renamed to\n<history-file>-<number>, where <number> is 1 or the smallest\nnumber after the last rotation." integer] 8) | |
9 | #@258 Functions determining whether to log an incoming message stanza. | |
10 | The functions in this list are called with two arguments, | |
11 | the connection and the full message stanza. | |
12 | If any of the functions returns non-nil, the stanza is not logged | |
13 | in the message history.\1f | |
14 | (defvar jabber-history-inhibit-received-message-functions nil (#$ . 2327)) | |
15 | #@70 Return non-nil if HISTORY-FILE should be rotated. | |
16 | ||
17 | (fn HISTORY-FILE)\1f | |
18 | (defalias 'jabber-rotate-history-p #[257 "\b\205\13\0\302\ 1!\205\13\0\303\304\ 2!8\305\245 V\207" [jabber-history-enable-rotation jabber-history-size-limit file-exists-p 7 file-attributes 1024] 4 (#$ . 2665)]) | |
19 | #@75 Rename HISTORY-FILE to HISTORY-FILE-TRY. | |
20 | ||
21 | (fn HISTORY-FILE &optional TRY)\1f | |
22 | (defalias 'jabber-history-rotate #[513 "\300\ 1\206\ 6\0\301!\302\ 3\303\ 3Q!\203\1e\0\304\ 3\ 3\203\e\0\ 3T\202\1c\0\301\"\207\305\ 3\211\303\ 4Q\"\207" [number-to-string 1 file-exists-p "-" jabber-history-rotate rename-file] 8 (#$ . 2940)]) | |
23 | (add-to-list 'jabber-message-chain 'jabber-message-history) | |
24 | #@167 Log message to log file. | |
25 | ||
26 | JC is the Jabber connection. | |
27 | XML-DATA is the parsed tree data from the stream (stanzas) | |
28 | obtained from `xml-parse-region'. | |
29 | ||
30 | (fn JC XML-DATA)\1f | |
31 | (defalias 'jabber-message-history #[514 "\b\204\ e\0\304 !\204\ e\0\305 !\210\306\ 1!\n\205^\0\211\203!\0\v\205^\0\211\205^\0\307\310\ 4\ 4#?\205^\0\ 1\311\ 1:\2055\0\312\ 2\ 2\"\266\202\313\ 3\314\"@\211AA\211\315\232?\205G\0\211\266\202@\316\ 4!\ 2\205\\\0\ 1\205\\\0\317\320\ 4\321\ 5\ 5%\266\203\207" [jabber-use-global-history jabber-history-dir jabber-history-enabled jabber-history-muc-enabled file-directory-p make-directory jabber-muc-message-p run-hook-with-args-until-success jabber-history-inhibit-received-message-functions from xml-get-attribute-or-nil jabber-xml-get-children body (("")) jabber-message-timestamp jabber-history-log-message "in" nil] 12 (#$ . 3297)]) | |
32 | (add-hook 'jabber-chat-send-hooks 'jabber-history-send-hook) | |
33 | #@49 Log outgoing message to log file. | |
34 | ||
35 | (fn BODY ID)\1f | |
36 | (defalias 'jabber-history-send-hook #[514 "\b\204\ e\0\304 !\204\ e\0\305 !\210\n\205\1a\0\306\307\310\v\ 5\311 %\207" [jabber-use-global-history jabber-history-dir jabber-history-enabled jabber-chatting-with file-directory-p make-directory jabber-history-log-message "out" nil current-time] 8 (#$ . 4167)]) | |
37 | #@173 Return a history filename for CONTACT. | |
38 | Return the global history filename, or (if the per-user file | |
39 | logging strategy is used) a history filename for CONTACT. | |
40 | ||
41 | (fn CONTACT)\1f | |
42 | (defalias 'jabber-history-filename #[257 "\b\203\ 6\0 \207\n\303\304\305\ 4!!Q\207" [jabber-use-global-history jabber-global-history-filename jabber-history-dir "/" symbol-name jabber-jid-symbol] 6 (#$ . 4517)]) | |
43 | #@55 Log a message. | |
44 | ||
45 | (fn DIRECTION FROM TO BODY TIMESTAMP)\1f | |
46 | (defalias 'jabber-history-log-message #[1285 "\303\304\305\"r\211q\210\306\307\ 2\"\216\310\311\ 4G\312\ 6\ 6$\210\313\ 3!\262\ 3\314\315\ 4\"\203/\0\316\317\312\305\ 6\ 6\312%\262\ 3\202\e\0\314\320\ 4\"\203C\0\316\321\312\305\ 6\ 6\312%\262\ 3\202/\0\322\323\324\ 4\206L\0\325 !\ 6\b\206S\0\326\ 6\b\203_\0\313\ 6 !\206`\0\327\ 6\b\203l\0\313\ 6 !\206m\0\327\ 6\b&\ 6c\210\330\331\ 6\ 6\206{\0\ 5!\ 1\18 \204\214\0\332\n!\204\214\0\333\n!\210\334\ 1!\203\226\0\335\ 1!\210\3361\245\0\337ed\ 3\305\340%0\202\255\0\341\342\343\ 3!\"\262\ 1)\266\202*\207" [coding-system-for-write jabber-use-global-history jabber-history-dir generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \0\302\300!\207" [V0 buffer-name kill-buffer] 2] set-text-properties 0 nil prin1-to-string string-match "\n" replace-match "\\n" "\r" "\\r" format "[\"%s\" \"%s\" %s %s %s]\n" jabber-encode-time current-time "in" "\"me\"" utf-8 jabber-history-filename file-directory-p make-directory jabber-rotate-history-p jabber-history-rotate (error) write-region quiet message "Unable to write history: %s" error-message-string] 14 (#$ . 4901)]) | |
47 | #@575 Return a list of vectors, one for each message matching the criteria. | |
48 | START-TIME and END-TIME are floats as obtained from `float-time'. | |
49 | Either or both may be nil, meaning no restriction. | |
50 | NUMBER is the maximum number of messages to return, or t for | |
51 | unlimited. | |
52 | DIRECTION is either "in" or "out", or t for no limit on direction. | |
53 | JID-REGEXP is a regexp which must match the JID. | |
54 | HISTORY-FILE is the file in which to search. | |
55 | ||
56 | Currently jabber-history-query performs a linear search from the end | |
57 | of the log file. | |
58 | ||
59 | (fn START-TIME END-TIME NUMBER DIRECTION JID-REGEXP HISTORY-FILE)\1f | |
60 | (defalias 'jabber-history-query #[1542 "\303\ 1!\205\353\0\304\305\306\"r\211q\210\307\310\ 2\"\216\311\18 \203 \0\312\ 2!\210\202f\0\313\314\n\306\315\316\317\ 6\b!!P#\211@\320\ 2A\321\"B\ 2\204d\0\211\204C\0\306\262\ 3\2025\0\211\ 1A\262\ 2\242\312\ 1!\210\ 6\b\247\203`\0\322ed\"\ 6 Y\203`\0\306\262\ 4\210\2025\0\266\ 3)\313\211db\210\3232\344\0\324 \210\325`\212\326 \210`){!@\262\ 1\ 6\b\203\222\0\327\330\ 2\331H!!\ 6 V\205\343\0\ 6\ 6\306=\204\241\0\ 1G\ 6\aW\205\343\0\ 5\306=\204\257\0\ 5\ 1\332H\230\203\327\0\ 6\a\203\301\0\ 6\a\327\330\ 3\331H!!V\203\327\0\333\ 5\334\335\ 4\336H\ 5\337HD\"@\"\203\327\0\211\ 2B\262\ 2o\203p\0\340\323\313\"\210\202p\00\210\ 1\266\202*\262\ 1\207" [coding-system-for-read jabber-use-global-history jabber-history-dir file-readable-p generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \0\302\300!\207" [V0 buffer-name kill-buffer] 2] utf-8 insert-file-contents nil directory-files "^" regexp-quote file-name-nondirectory sort string>-numerical count-lines beginning-of-file backward-sexp read-from-string forward-sexp jabber-float-time jabber-parse-time 0 1 string-match remove "me" 2 3 throw] 16 (#$ . 5998)]) | |
61 | (byte-code "\300\301\302\303\304DD\305\306\307\310\311&\a\210\300\312\302\303\313DD\314\306\307\310\315&\a\207" [custom-declare-variable jabber-backlog-days funcall function #[0 "\300\207" [3.0] 1 #1=""] "Age limit on messages in chat buffer backlog, in days." :group jabber :type (choice (number :tag "Number of days") (const :tag "No limit" nil)) jabber-backlog-number #[0 "\300\207" [10] 1 #1#] "Maximum number of messages in chat buffer backlog." integer] 8) | |
62 | #@312 Fetch context from previous chats with JID. | |
63 | Return a list of history entries (vectors), limited by | |
64 | `jabber-backlog-days' and `jabber-backlog-number'. | |
65 | If BEFORE is non-nil, it should be a float-time after which | |
66 | no entries will be fetched. `jabber-backlog-days' still | |
67 | applies, though. | |
68 | ||
69 | (fn JID &optional BEFORE)\1f | |
70 | (defalias 'jabber-history-backlog #[513 "\302\b\205\v\0\303 \b\304_Z\ 2 \305\306\307\310\ 6 !!\311Q\312\ 6\b!&\ 6\207" [jabber-backlog-days jabber-backlog-number jabber-history-query jabber-float-time 86400.0 t "^" regexp-quote jabber-jid-user "\\(/.*\\)?$" jabber-history-filename] 11 (#$ . 8109)]) | |
71 | #@43 Migrate global history to per-user files.\1f | |
72 | (defalias 'jabber-history-move-to-per-user #[0 "\304\b!\203\n\0\305\306!\210\307\b!\210\310\19\311\312\313\"r\211q\210\314\315\ 2\"\216\316\1a\317\v!\210)\320\321!\205/\0\321\322ed#\310\211m\204\225\0`\310y\210`\ 1\ 1{\323\ 1!@\211\324H\325\230\203O\0\211\326H\202R\0\211\324H\211\ 6\a\232\204s\0\ 6\ 6\203m\0\327\ 6\a!\330\ 6\a\ 6\a\ 3\313\331%\266\ 2\211\262\a\ 4\262\ 6\320\332!\203\220\0\ 6\a`\310\ 1\247\203\211\0\ 1\ 3@Y\205\216\0\333\ 3\ 3\ 3#\266\ 4\266\ 5\2021\0\ 1\203\245\0\327\ 2!\330\ 2d\ 3\313\331%\266\ 2\266\ 3*\210)\334\335!\207" [jabber-history-dir jabber-use-global-history coding-system-for-read jabber-global-history-filename file-directory-p error "Per-user history directory already exists" make-directory nil generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \0\302\300!\207" [V0 buffer-name kill-buffer] 2] utf-8 insert-file-contents fboundp make-progress-reporter "Migrating history..." read-from-string 2 "me" 3 jabber-history-filename write-region quiet progress-reporter-update progress-reporter-do-update message "Done. Please change `jabber-use-global-history' now."] 16 (#$ . 8713) nil]) | |
73 | (provide 'jabber-history) |