mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-21 23:54:22 +01:00
Improve ement password handling
Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
parent
dd3de246a8
commit
931b5aa764
|
@ -13,11 +13,15 @@
|
|||
(with-current-buffer " *ement-pass*"
|
||||
(ement-connect
|
||||
:uri-prefix "http://localhost:8008"
|
||||
:password (string-trim (substring-no-properties (buffer-string)))
|
||||
:password (let ((password (string-trim (substring-no-properties (buffer-string)))))
|
||||
(if (not (equal (process-exit-status process) 0))
|
||||
(read-passwd "Ement password: ")
|
||||
password))
|
||||
:user-id "@magic_rb:matrix.redalder.org")
|
||||
(kill-buffer))))
|
||||
|
||||
(defun after-init-ement-connect ()
|
||||
(interactive)
|
||||
(set-process-sentinel (start-process "ement-pass" " *ement-pass*" "pass" "Matrix/@magic_rb:matrix.redalder.org") #'ement-connect-sentinel))
|
||||
|
||||
(use-package ement
|
||||
|
@ -27,7 +31,7 @@
|
|||
(ement-save-sessions t)
|
||||
:config
|
||||
(remove-hook 'ement-after-initial-sync-hook #'ement-room-list--after-initial-sync)
|
||||
(add-hook 'after-init-hook #'after-init-ement-connect))
|
||||
(setf ement-sessions (ement--read-sessions)))
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
|
|
Loading…
Reference in a new issue