More features

This commit is contained in:
2026-06-10 12:43:24 -04:00
parent 02d78765bc
commit dcead245a7
12 changed files with 954 additions and 21 deletions
+15 -6
View File
@@ -9,6 +9,7 @@
(require 'noise-db)
(require 'noise-new-chat)
(require 'noise-conversation)
(require 'cl-lib)
(defvar noise-chat-list-mode-map
@@ -113,21 +114,29 @@ CONV is a hash table with string keys from noise-db."
preview-str " "
(propertize time-str 'face 'shadow))))
(defun noise-chat-list--conversation-at-point ()
"Return the conversation on the current line, or nil."
(let ((conversations (noise-db-get-all-conversations))
(idx (1- (line-number-at-pos))))
(nth idx conversations)))
(defun noise-chat-list-open ()
"Open the conversation at point."
(interactive)
(let* ((conversations (noise-db-get-all-conversations))
(idx (1- (line-number-at-pos)))
(conv (nth idx conversations)))
(let ((conv (noise-chat-list--conversation-at-point)))
(if conv
(message "Open conversation: %s (not yet implemented)"
(gethash "name" conv))
(noise-conversation-open (gethash "id" conv))
(message "No conversation on this line."))))
(defun noise-chat-list-mark-read ()
"Mark the conversation at point as read."
(interactive)
(message "Mark read: not yet connected to signal-cli"))
(let ((conv (noise-chat-list--conversation-at-point)))
(if conv
(progn
(noise-db-mark-conversation-read (gethash "id" conv))
(noise-chat-list--render))
(message "No conversation on this line."))))
(defun noise-chat-list-refresh ()
"Refresh the chat list (re-render from database)."