correspond.channels.signal#
Signal through signal-cli-rest-api (JSON-RPC mode): listen, read what was logged, send.
References
signal: (the linked account’s receive stream, for listen),
signal:+<number> (a person, by international phone number or Signal uuid) and
signal:group.<id> (a group, by the REST API’s group id).
Signal has no bot API. signal-cli runs as a linked device (or a registered number) of
an account you control, and the REST wrapper exposes it: POST /v2/send to send,
GET /v1/receive/<number> (a WebSocket in JSON-RPC mode) to receive. The WebSocket client
is the optional websocket-client (extra signal); tests and other transports pass
ws=.
Three facts shape the adapter:
There is no history before linking:
readreturns only whatlistenandsendlogged on this machine (history_depth = since_link).signal-clireleases older than about three months stop working against Signal’s servers, so a silent channel may just be an old release (requirements signalsays so).Whether to trust a changed safety number is an authenticity policy of the server (
--trust-new-identities).listencompares the account’s known identities on every poll and reports a changed safety number as anidentity.changedevent.
>>> Signal().parse_ref("group.ZXhhbXBsZQ==").kind
'group'
Functions
What stops Signal working from this configuration; the signal-cli age caveat is a note, not a problem. |
|
|
Text frames of the WebSocket at |
Classes
|
A Signal account linked to a |
- class correspond.channels.signal.Signal(*, http=<function urllib_http>, ws=<function websocket_frames>, log=None)[source]#
Bases:
objectA Signal account linked to a
signal-cli-rest-apiserver.- audience(ref, *, draft=None)[source]#
Who reads a conversation: a person’s is
named; a group’s members are listed by the REST API.- Return type:
- property capabilities: Capabilities#
A linked device’s view of Signal.
- property log: MutableMapping[str, Any]#
Every message received or sent, as JSON, keyed
<conversation id>/<message id>.json; identities seen sit underidentities/.
- parse_ref(id)[source]#
""(the account’s stream), a phone number or uuid, orgroup.<id>.- Return type:
- poll(ref, *, cursor=None, limit=None)[source]#
What the WebSocket delivered within
listen_wait_s, then any safety-number changes.Signal hands each message to the receiver once, so the cursor (the last envelope timestamp) only marks progress;
delivery_idis what dedupes.