Updated DBus service (markdown)

AsamK 2018-05-08 22:18:24 +02:00
parent 6e432402a4
commit db5d63e52e

@ -37,3 +37,25 @@ To avoid the startup time of the JVM for the dbus client, you can use any dbus c
Example with `dbus-send`:
dbus-send --session --type=method_call --print-reply --dest="org.asamk.Signal" /org/asamk/Signal org.asamk.Signal.sendMessage string:MessageText array:string: string:RECIPIENT
### Receive messages from signal-cli daemon
The signal-cli daemon publishes new messages to dbus.
Here's an example using python:
```python3
def msgRcv (timestamp, source, groupID, message, attachments):
print ("Message", message, "received in group", signal.getGroupName (groupID))
return
from pydbus import SystemBus
from gi.repository import GLib
bus = SystemBus()
loop = GLib.MainLoop()
signal = bus.get('org.asamk.Signal')
signal.onMessageReceived = msgRcv
loop.run()
```