8d820432ff
- Change default noise-signal-cli-address to port 8080 (signal-cli's --http default) - Replace getVersion (not a valid JSON-RPC method) with noisePing probe - noise-rpc-check now returns t on any valid JSON-RPC response - Update README to reflect correct default port
52 lines
1.2 KiB
EmacsLisp
52 lines
1.2 KiB
EmacsLisp
;;; noise.el --- Signal Messenger client for Emacs -*- lexical-binding: t; -*-
|
|
|
|
;; Author: Noise contributors
|
|
;; Version: 0.1.0
|
|
;; Package-Requires: ((emacs "27.1"))
|
|
;; Keywords: comm
|
|
|
|
;;; Commentary:
|
|
|
|
;; Noise is a Signal Messenger client powered by signal-cli JSON-RPC.
|
|
|
|
;;; Code:
|
|
|
|
(require 'noise-rpc)
|
|
(require 'noise-chat-list)
|
|
|
|
(defgroup noise nil
|
|
"Signal Messenger client for Emacs."
|
|
:group 'comm
|
|
:prefix "noise-")
|
|
|
|
(defcustom noise-signal-cli-address "http://localhost:8080"
|
|
"Base URL of the signal-cli JSON-RPC daemon.
|
|
Format: http://HOST:PORT
|
|
The default port is 8080, matching signal-cli's `--http` default."
|
|
:type 'string
|
|
:group 'noise)
|
|
|
|
;;;###autoload
|
|
(defun noise-check-connection ()
|
|
"Check connectivity to the signal-cli JSON-RPC daemon."
|
|
(interactive)
|
|
(condition-case err
|
|
(progn
|
|
(noise-rpc-check)
|
|
(message "signal-cli connected at %s" noise-signal-cli-address))
|
|
(noise-rpc-error
|
|
(message "Error: %s" (cdr err)))))
|
|
|
|
;;;###autoload
|
|
(define-minor-mode noise-mode
|
|
"Toggle Noise Signal client mode."
|
|
:global t
|
|
:lighter " Noise"
|
|
:group 'noise
|
|
(if noise-mode
|
|
(noise-chat-list)
|
|
(message "Noise mode disabled")))
|
|
|
|
(provide 'noise)
|
|
;;; noise.el ends here
|