Adds account switching

This commit is contained in:
2026-06-10 12:12:31 -04:00
parent 8d820432ff
commit 02d78765bc
8 changed files with 330 additions and 2 deletions
+11
View File
@@ -11,6 +11,7 @@
(require 'cl-lib)
(defvar noise-signal-cli-address)
(defvar noise-account)
(define-error 'noise-rpc-error "signal-cli JSON-RPC error")
@@ -67,6 +68,16 @@ Signals `noise-rpc-error` on failure or connection error."
result))
(kill-buffer buf)))))
(defun noise-rpc-call-for-account (method &rest params)
"Call signal-cli JSON-RPC METHOD with PARAMS for the configured account.
Like `noise-rpc-call', but when `noise-account' is set the `account'
parameter is added to the request. Account-scoped methods (such as
listContacts or send) require it when the daemon serves multiple
accounts."
(if (and (boundp 'noise-account) noise-account)
(apply #'noise-rpc-call method :account noise-account params)
(apply #'noise-rpc-call method params)))
(defun noise-rpc--parse-response (raw)
"Parse RAW JSON-RPC response body.
Returns the `result` on success.