Extract static methods from Main

This commit is contained in:
AsamK 2018-11-19 22:40:16 +01:00
parent 184354ffb7
commit 860ec6f5dc
8 changed files with 520 additions and 440 deletions

View file

@ -0,0 +1,25 @@
package org.asamk.signal;
import org.asamk.signal.manager.Manager;
import org.freedesktop.dbus.DBusConnection;
import org.whispersystems.signalservice.api.messages.SignalServiceContent;
import org.whispersystems.signalservice.api.messages.SignalServiceEnvelope;
class DbusReceiveMessageHandler extends ReceiveMessageHandler {
private final DBusConnection conn;
private final String objectPath;
DbusReceiveMessageHandler(Manager m, DBusConnection conn, final String objectPath) {
super(m);
this.conn = conn;
this.objectPath = objectPath;
}
@Override
public void handleMessage(SignalServiceEnvelope envelope, SignalServiceContent content, Throwable exception) {
super.handleMessage(envelope, content, exception);
JsonDbusReceiveMessageHandler.sendReceivedMessageToDbus(envelope, content, conn, objectPath, m);
}
}