Using Signal as a collective receiver and broadcaster to replace Signal Boost with signal-cli
The big breakthrough for me was being told by wolcen that signal-cli could be used to register a phone number with Signal. Before that i had been trying to follow guides like this but having no success because my Android devices available already had Signal app in use and did not have multiuser capability enabled or was an old Android tablet which Signal does not support (not any tablets, i don’t think).
This is also how we would hook up our website or server: https://github.com/AsamK/signal-cli/wiki/Linking-other-devices-(Provisioning)
Installation
Currently using this locally with a manual wget of a specific version, which is not my favorite, but it is the installation instructions from the README
Parsing the results of receive
What follows are some examples of responses to $ signal-cli -a +16175551234 receive
which we may want to understand programmatically so as to be able to respond automatically.
Checking if a message was read
There’s too many people who installed Signal but have dropped off using it. We would like to know then this is the case, so we can send these people regular SMS messages instead, if we have that set up as an option.
Envelope from: “Agaric Tech Collective” +15082833557 (device: 2)
Timestamp: 1650861026504 (2022-04-25T04:30:26.504Z)
Server timestamps: received: 1650861026583 (2022-04-25T04:30:26.583Z) delivered: 1650861048853 (2022-04-25T04:30:48.853Z)
Sent by unidentified/sealed sender
Received a receipt message
When: 1650861026504 (2022-04-25T04:30:26.504Z)
Is read receipt
Timestamps:
- 1650860991942 (2022-04-25T04:29:51.942Z)
Checking if a message was received
Just realizing that i don’t actually care if a message was read so much as that it was received by a person’s device. I think that is also told to us and i think that looks like this:
Envelope from: “Agaric Tech Collective” +15082833557 (device: 2)
Timestamp: 1650860993173 (2022-04-25T04:29:53.173Z)
Server timestamps: received: 1650860993232 (2022-04-25T04:29:53.232Z) delivered: 1650861007214 (2022-04-25T04:30:07.214Z)
Sent by unidentified/sealed sender
Received a receipt message
When: 1650860993173 (2022-04-25T04:29:53.173Z)
Is delivery receipt
Timestamps:
- 1650860991942 (2022-04-25T04:29:51.942Z)
The simple PHP wrapper for signal-cli does not parse this at all for us; we’ll have to do that ourselves. (I checked to see if signald was better and i could not find a command or documentation for receiving messages at all, so, going with no on that.)
Acknowledging a reaction
Envelope from: “Agaric Tech Collective” +15082833557 (device: 2)
Timestamp: 1650861951271 (2022-04-25T04:45:51.271Z)
Server timestamps: received: 1650861951370 (2022-04-25T04:45:51.370Z) delivered: 1650861963571 (2022-04-25T04:46:03.571Z)
Sent by unidentified/sealed sender
Message timestamp: 1650861951271 (2022-04-25T04:45:51.271Z)
Profile key update
Reaction:
Emoji: 👍
Target author: “Solidarity Network” +16127129191
Target timestamp: 1650860991942 (2022-04-25T04:29:51.942Z)
Is remove: false
Envelope from: “Agaric Tech Collective” +15082833557 (device: 2)
Timestamp: 1650861963627 (2022-04-25T04:46:03.627Z)
Server timestamps: received: 1650861963919 (2022-04-25T04:46:03.919Z) delivered: 1650861963922 (2022-04-25T04:46:03.922Z)
Receiving messages
Envelope from: “Agaric Tech Collective” +15082833557 (device: 2)
Timestamp: 1650862095013 (2022-04-25T04:48:15.013Z)
Server timestamps: received: 1650862095141 (2022-04-25T04:48:15.141Z) delivered: 1650862108933 (2022-04-25T04:48:28.933Z)
Sent by unidentified/sealed sender
Message timestamp: 1650862095013 (2022-04-25T04:48:15.013Z)
Body: msg 1
Profile key update
Envelope from: “Agaric Tech Collective” +15082833557 (device: 2)
Timestamp: 1650862097429 (2022-04-25T04:48:17.429Z)
Server timestamps: received: 1650862097542 (2022-04-25T04:48:17.542Z) delivered: 1650862108933 (2022-04-25T04:48:28.933Z)
Sent by unidentified/sealed sender
Message timestamp: 1650862097429 (2022-04-25T04:48:17.429Z)
Body: msg 2
Profile key update
Envelope from: “Agaric Tech Collective” +15082833557 (device: 2)
Timestamp: 1650862109044 (2022-04-25T04:48:29.044Z)
Server timestamps: received: 1650862109330 (2022-04-25T04:48:29.330Z) delivered: 1650862109332 (2022-04-25T04:48:29.332Z)
Filed issue for doing all this parsing in the PHP wrapper:
https://github.com/jigarakatidus/php-signal/issues/11
Doing our own PHP wrapper for shell command line interface stuff
https://packagist.org/packages/mikehaertl/php-shellcommand
Check if a number is on Signal
signal-cli check if number is on signal
getUserStatus
https://github.com/bbernhard/signal-cli-rest-api/issues/50
Honestly we may not really want this so much as the above, like someone may have a registered number but we want to know if they actually receive stuff on Signal. Probably we need both, and maybe the check on whether we should try using Signal or SMS should be performed at times when not sending anything at all (this part of the test at least) or for messages not deemed urgent (checking if it is received, when someone that is ‘on Signal’ but we moved to text due to non-receipt should be tried on Signal again after 40 days or such.