diff options
author | jao <jao@gnu.org> | 2020-03-27 17:51:14 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2020-03-27 17:51:14 +0000 |
commit | 82d7a017c4688458547e5cf1afc8da9cbf96aa0d (patch) | |
tree | 7c05fa31a63a6890d0d43a2f5d6d83de96a5ddca /net | |
parent | 1385e63e99ae46a32aeb1bb15895ee634dd5f7ec (diff) | |
download | elibs-82d7a017c4688458547e5cf1afc8da9cbf96aa0d.tar.gz elibs-82d7a017c4688458547e5cf1afc8da9cbf96aa0d.tar.bz2 |
signel tweaks
Diffstat (limited to 'net')
-rw-r--r-- | net/signel.org | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/net/signel.org b/net/signel.org index bbf74d7..924ecf6 100644 --- a/net/signel.org +++ b/net/signel.org @@ -369,12 +369,14 @@ With that, we're finally ready to insert messages in our signel chat buffers: #+begin_src emacs-lisp +(defvar signel-report-deliveries t) + (defun signel--update-chat-buffer (source data stamp rec-stamp msg) (when-let ((b (signel--contact-buffer source))) (with-current-buffer b (goto-char (point-max)) (beginning-of-line) - (ignore-errors (kill-line)) + (ignore-errors (delete-char (length signel-prompt))) (if data (let ((p (point))) (insert (signel--timestamp "[" stamp "] ") @@ -382,21 +384,25 @@ buffers: (signel--prompt) data "\n") - (fill-region p (point))) + (fill-region p (point)) + (insert (signel--prompt))) (let ((is-delivery (or (signel--msg-is-delivery msg) (signel--msg-is-receipt msg))) (is-read (signel--msg-is-read msg))) - (when (or rec-stamp stamp) + (when (and (or rec-stamp stamp) + (not (string= source signel-cli-user)) + signel-report-deliveries) (insert (signel--timestamp "*" (or rec-stamp stamp) "* ") (signel--notice (if is-read "(read)" "(delivered)")) - "\n")))) - (insert (signel--prompt))) + "\n") + (insert (signel--prompt))))) + (end-of-line)) (when (fboundp 'tracking-add-buffer) (tracking-add-buffer b '(signel-notification-face))))) #+end_src There are some rough edges in the above implementation that must be -polished shold signel ever be released in the wild. For one, proper +polished should signel ever be released in the wild. For one, proper handling of timestamps and their formats. And of course notifications should be much more customizable (here i'm using [[https://github.com/jorgenschaefer/circe/blob/master/tracking.el][Circe's tracking.el]] if available). |