Adds account switching
This commit is contained in:
+5
-2
@@ -9,6 +9,7 @@
|
||||
;;; Code:
|
||||
|
||||
(require 'noise-db)
|
||||
(require 'noise-new-chat)
|
||||
|
||||
(defun noise-switcher ()
|
||||
"Switch to a Signal conversation via minibuffer completion.
|
||||
@@ -31,8 +32,9 @@ Shows existing conversations and contacts without conversations."
|
||||
(if (gethash "id" item)
|
||||
;; It's a conversation (has an id)
|
||||
(message "Open conversation: %s (not yet implemented)" (gethash "name" item))
|
||||
;; It's just a contact — create conversation stub
|
||||
(message "New conversation with: %s (not yet implemented)" choice))
|
||||
;; It's a contact without a conversation — start one
|
||||
(noise-new-chat-with-contact (gethash "contact_id" item)
|
||||
(gethash "name" item)))
|
||||
(message "Unknown selection: %s" choice))))))
|
||||
|
||||
(defun noise-switcher--collection ()
|
||||
@@ -57,6 +59,7 @@ Returns an alist of (display-string . hash-table)."
|
||||
(unless (gethash contact-id conv-contacts)
|
||||
;; Contact without conversation - add a stub
|
||||
(let ((ht (make-hash-table :test 'equal)))
|
||||
(puthash "contact_id" contact-id ht)
|
||||
(puthash "name" name ht)
|
||||
(puthash "type" "direct" ht)
|
||||
(puthash "unread_count" 0 ht)
|
||||
|
||||
Reference in New Issue
Block a user