summaryrefslogtreecommitdiffhomepage
path: root/net/signel.org
diff options
context:
space:
mode:
Diffstat (limited to 'net/signel.org')
-rw-r--r--net/signel.org18
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).