signal-cli-rest-api icon indicating copy to clipboard operation
signal-cli-rest-api copied to clipboard

Disappearing messages disabled by signal-cli

Open udlch opened this issue 5 years ago • 6 comments

Hi, Bernhard. Thank you. Now I can send messages from my home server, torrent client and HA of course. It's very useful setup. I've been set up disappearing messages at my android signal client but it disabled every time i get messages from cli. Looks like AsamK/signal-cli support disappearing messages, but necessary condition for this Is receive message command.

Is it possible add disappearing messages at your project? Maybe this setting is somewhere in the configuration file?

photo_2020-01-17_09-32-34

udlch avatar Jan 17 '20 06:01 udlch

Hi,

glad to hear that the char encoding issue is now resolved :)

regarding the disappearing messages: I've found this ticket here in the signal-cli repository: https://github.com/AsamK/signal-cli/issues/153. According to the ticket it should be possible to set the expiration timer manually in the config file. However, I haven't found any information what exactly needs to be changed in the configuration file in order to accomplish that. I'll have a look in the signal-cli sourcecode if I can find anything that points me in the right direction. If you find out more, please let me know :)

bbernhard avatar Jan 18 '20 13:01 bbernhard

@bbernhard an option is to set the disappearing mode as you did, then let the cli client download the settings by running signal-cli -u receive. It will send messages with the timeout you set after that. However knowing the option in the config file where it can be changed would be nice!

KanoczTomas avatar Feb 16 '20 20:02 KanoczTomas

Hello guys,

this can be pretty easily done with the config files for the numbers. First I needed to learn how to access the file system. But thats pretty straight forward.

This way you can change the disappearing msges

  1. docker ps note here the ID
  2. docker exec -it <ID> /bin/bash
  3. apt-get update && apt-get install nano you can even do the change with sed, or install any other editor you like
  4. edit the files in /home/.local/share/signal-cli/data/ There are at least two files if you configured a channel for another number already
  5. edit "messageExpirationTime" : 0 to "messageExpirationTime" : 300 for both files. At least the number which is sending the messages is needed. 300 = 5 Minutes.

I've just rebooted the pi. triggered my automation et voila, it is set to 5 minutes for dissappearing messages.

Cheers

fastboot

f45tb00t avatar Nov 26 '20 17:11 f45tb00t

Cool, thanks a lot for sharing!

Just a small additional note to the excellent How-to @f45tb00t provided: When changing the value in the config file, make sure that no one (e.g Home Automation automations) is using the API while editing, otherwise you could corrupt your config file.

btw: looks like setting the expiration time is also now part of the official signal-cli API (see: https://github.com/AsamK/signal-cli/pull/308/files). I'll have a look whether we can add that to the REST API too.

bbernhard avatar Nov 26 '20 17:11 bbernhard

You're welcome :)

Could you please have a look at the dbus thingi? I wrote/asked in another related issue, too. Because I've a delay from 10 up to 15 seconds until I receive the messages. Just a container for sending with dbus would be awesome. Or point me in the right direction and I will check if I can fix this. But I did not work that much with docker yet.

f45tb00t avatar Nov 26 '20 17:11 f45tb00t

Editing the config files didn't work for me. I set the expiration time on my client (Smartphone). Than I did a receive API call

curl -X GET -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/receive/<number>'

hajo62 avatar Dec 28 '21 15:12 hajo62