;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\310%\210\311\312\305\313\314\315\307\304&\210\311\316\305\317\314\315\307\304&\210\311\320\321\322\314\323\307\304&\210\311\324\325\326\314\327\307\304&\210\311\330\331\332\314\315\307\304&\210\311\333\305\334\314\315\307\304&\210\311\335\336\337\314\340\307\304&\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 "Non-nil means message logging is enabled." :type boolean jabber-history-muc-enabled "Non-nil means MUC logging is enabled.\nDefault is nil, cause MUC logging may be i/o-intensive." jabber-history-dir (locate-user-emacs-file "jabber-history" ".emacs-jabber") "Base directory where per-contact history files are stored.\nUsed only when `jabber-use-global-history' is nil." directory jabber-global-history-filename (locate-user-emacs-file "jabber-global-message-log" ".jabber_global_message_log") "Global file where all messages are logged.\nUsed when `jabber-use-global-history' is non-nil." file jabber-use-global-history (file-exists-p jabber-global-history-filename) "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 "Whether history files should be renamed when reach\n`jabber-history-size-limit' kilobytes. If nil, history files\nwill grow indefinitely, otherwise they'll be renamed to\n-, where is 1 or the smallest\nnumber after the last rotation." jabber-history-size-limit 1024 "Maximum history file size in kilobytes.\nWhen history file reaches this limit, it is renamed to\n-, where is 1 or the smallest\nnumber after the last rotation." integer] 8) #@258 Functions determining whether to log an incoming message stanza. The functions in this list are called with two arguments, the connection and the full message stanza. If any of the functions returns non-nil, the stanza is not logged in the message history. (defvar jabber-history-inhibit-received-message-functions nil (#$ . 2018)) #@48 Return true if HISTORY-FILE should be rotated. (defalias 'jabber-rotate-history-p #[(history-file) "\205\303 !\205\304\305 !8\306\245\nV\207" [jabber-history-enable-rotation history-file jabber-history-size-limit file-exists-p 7 file-attributes 1024] 3 (#$ . 2356)]) #@42 Rename HISTORY-FILE to HISTORY-FILE-TRY. (defalias 'jabber-history-rotate #[(history-file &optional try) "\303\206\304!\305\n\306 Q!\203!\307\n\203T\202\304\"\202(\310\n\211\306 Q\")\207" [try suffix history-file number-to-string 1 file-exists-p "-" jabber-history-rotate rename-file] 5 (#$ . 2634)]) (add-to-list 'jabber-message-chain 'jabber-message-history) #@26 Log message to log file. (defalias 'jabber-message-history #[(jc xml-data) "\204\306 !\204\307 !\210\310\n!\f\205r \203\" \205r \205r\311\312\n#?\205r\n\313\211:\205=\314\"*\315\n\316\"@\211AA\211\317\232?\205S*@\320\n!\211 \205q\205q\321\322 \323%+)\207" [jabber-use-global-history jabber-history-dir xml-data is-muc 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 jc attribute node children timestamp text] 7 (#$ . 3013)]) (add-hook 'jabber-chat-send-hooks 'jabber-history-send-hook) #@35 Log outgoing message to log file. (defalias 'jabber-history-send-hook #[(body id) "\204\305 !\204\306 !\210\n\205\307\310\311 \f\312 %\207" [jabber-use-global-history jabber-history-dir jabber-history-enabled jabber-chatting-with body file-directory-p make-directory jabber-history-log-message "out" nil current-time] 6 (#$ . 3813)]) #@118 Return a history filename for CONTACT if the per-user file loggin strategy is used or the global history filename. (defalias 'jabber-history-filename #[(contact) "\203 \207\n\304\305\306 !!Q\207" [jabber-use-global-history jabber-global-history-filename jabber-history-dir contact "/" symbol-name jabber-jid-symbol] 5 (#$ . 4161)]) #@15 Log a message (defalias 'jabber-history-log-message #[(direction from to body timestamp) "\306\307\310\"rq\210\311\216\312\313 G\314 $\210\315 !\316\317 \"\203)\320\321\314\310 \314%\202\316\322 \"\203;\320\323\314\310 \314%\202)\324\325\326\n\206D\327 ! \206J\330\f\203T\315\f!\206U\331 \203_\315 !\206`\331 &c\210\332\333\f\206l !&'(\204\202\334)!\204\202\335)!\210\336&!\203\216\337&!\210\3401\236\341ed&\310\342%0\202\250*\343\344\345*!\")-\207" [#1=#:temp-buffer body timestamp direction from to generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] set-text-properties 0 nil prin1-to-string string-match "\n" replace-match "\\n" " " "\\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 history-file coding-system-for-write jabber-use-global-history jabber-history-dir e] 7 (#$ . 4504)]) #@508 Return a list of vectors, one for each message matching the criteria. START-TIME and END-TIME are floats as obtained from `float-time'. Either or both may be nil, meaning no restriction. NUMBER is the maximum number of messages to return, or t for unlimited. DIRECTION is either "in" or "out", or t for no limit on direction. JID-REGEXP is a regexp which must match the JID. HISTORY-FILE is the file in which to search. Currently jabber-history-query performs a linear search from the end of the log file. (defalias 'jabber-history-query #[(start-time end-time number direction jid-regexp history-file) "\306!\205\375\307\310\311\"r q\210\312\216\313 \203\314!\210\202l\315\316 \311\317\320\321!!P#\211#@\322#A\323\"B#\f\204k#\204G\311\211\2029#\211A#\242$\314$!\210%\247\203g\324ed\"%Y\203g\311)\2028+)\315\211&'db\210\3252\371\326 \210\327`\212\330 \210`){!@&(\203\235\331\332&\333H!!(V\205\370%\311=\204\255'G%W\205\370)\311=\204\276)&\334H\230\203\354*\203\321*\331\332&\333H!!V\203\354\335+\336\337&\340H&\341HD\"@\"\203\354&'B'o\203z\342\325\315\"\210\202z0\210'-\207" [history-file #1=#:temp-buffer coding-system-for-read jabber-use-global-history lines-collected jabber-history-dir file-readable-p generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# 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 matched-files file number current-line collected start-time direction end-time jid-regexp] 8 (#$ . 5608)]) (byte-code "\300\301\302\303\304\305\306\307&\210\300\310\311\312\304\305\306\313&\207" [custom-declare-variable jabber-backlog-days 3.0 "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 10 "Maximum number of messages in chat buffer backlog" integer] 8) #@285 Fetch context from previous chats with JID. Return a list of history entries (vectors), limited by `jabber-backlog-days' and `jabber-backlog-number'. If BEFORE is non-nil, it should be a float-time after which no entries will be fetched. `jabber-backlog-days' still applies, though. (defalias 'jabber-history-backlog #[(jid &optional before) "\304\205 \305 \306_Z \n\307\310\311\312 !!\313Q\314 !&\207" [jabber-backlog-days before jabber-backlog-number jid jabber-history-query jabber-float-time 86400.0 t "^" regexp-quote jabber-jid-user "\\(/.*\\)?$" jabber-history-filename] 9 (#$ . 7718)]) #@43 Migrate global history to per-user files. (defalias 'jabber-history-move-to-per-user #[nil "\306!\203\n\307\310!\210\311!\210\312\313\314\315\"r\nq\210\316\216\317\320\f!\210)\321\322!\205-\322\323ed#\312\211 m\204\251`!\312y\210`\"!\"{#\324#!@\211$\325H\326\230\203^$\327H\202b$\325H\211%\232\204\210\203\201\330!&\331 !&\315\332%\210)%!\321\333!\203\245 `\312\247\203\236@Y\205\243\334#\266-\2024\203\276\330!&\331 d&\315\332%\210).\335\336!\207" [jabber-history-dir jabber-use-global-history #1=#:temp-buffer coding-system-for-read jabber-global-history-filename jid-start file-directory-p error "Per-user history directory already exists" make-directory nil generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# 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." current-jid progress-reporter start end line parsed jid history-file] 8 (#$ . 8323) nil]) (provide 'jabber-history)