bbernhard / signal-cli-rest-api

Dockerized Signal Messenger REST API
https://bbernhard.github.io/signal-cli-rest-api/
MIT License
1.37k stars 160 forks source link

Disappearing messages disabled by signal-cli #4

Open udlch opened 4 years ago

udlch commented 4 years ago

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

bbernhard commented 4 years ago

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 :)

KanoczTomas commented 4 years ago

@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!

f45tb00t commented 3 years ago

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

bbernhard commented 3 years ago

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.

f45tb00t commented 3 years ago

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.

hajo62 commented 2 years ago

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>'