X-Git-Url: https://git.shemshak.org/~bandali/configs/blobdiff_plain/ccb32b49c84c49070c5a5c5764a5b26d305e2584..4a102022bba2f081c58d6814a8795a898d80a8c3:/.emacs.d/lisp/bandali-erc.el diff --git a/.emacs.d/lisp/bandali-erc.el b/.emacs.d/lisp/bandali-erc.el index 3527a65..b6bcdee 100644 --- a/.emacs.d/lisp/bandali-erc.el +++ b/.emacs.d/lisp/bandali-erc.el @@ -33,7 +33,7 @@ erc-email-userid "bandali" erc-format-nick-function 'erc-format-@nick erc-join-buffer 'bury - erc-lurker-hide-list '("JOIN" "PART" "QUIT") + ;; erc-lurker-hide-list '("JOIN" "PART" "QUIT") erc-nick "bandali" erc-prompt "erc>" erc-prompt-for-password nil @@ -92,10 +92,24 @@ ;; (erc-fill-mode -1) ;; erc-log + (defun b/erc-log-directory (buffer target _nick server _port) + (let ((directory (concat (b/var "erc/logs/") + ;; (or (with-current-buffer buffer + ;; (symbol-name erc-network)) + ;; server) + server + (if (erc-server-buffer-p buffer) + (concat "/" server) + (and target (concat "/" target)))))) + (unless (file-exists-p directory) + (make-directory directory 'make-parents)) + directory)) + (defun b/erc-log-file-name (&rest _) + (concat (format-time-string "%Y-%m-%d") ".log")) (csetq ;; erc-enable-logging 'erc-log-all-but-server-buffers - erc-generate-log-file-name-function 'erc-generate-log-file-name-with-date - erc-log-channels-directory (b/var "erc/logs") + erc-generate-log-file-name-function #'b/erc-log-file-name + erc-log-channels-directory #'b/erc-log-directory erc-log-file-coding-system 'utf-8 erc-log-write-after-insert t erc-log-write-after-send t @@ -151,22 +165,19 @@ (lambda () (interactive) (erc-tls :server "chat.freenode.net" :port 6697 - :client-key (b/var "erc/certs/bandali-freenode.key") - :client-crt (b/var "erc/certs/bandali-freenode.crt")))) + :client-certificate t))) (global-set-key (kbd "C-c a e o") (lambda () (interactive) (erc-tls :server "irc.oftc.net" :port 6697 - :client-key (b/var "erc/certs/bandali-oftc.key") - :client-crt (b/var "erc/certs/bandali-oftc.crt")))) + :client-certificate t))) (global-set-key (kbd "C-c a e t") (lambda () (interactive) (erc-tls :server "na.tilde.chat" :port 6697 - :client-key (b/var "erc/certs/bandali-tildechat.key") - :client-crt (b/var "erc/certs/bandali-tildechat.crt")))) + :client-certificate t))) (provide 'bandali-erc) ;;; bandali-erc.el ends here