Update dependencies

This commit is contained in:
AsamK 2017-01-28 08:52:51 +01:00
parent 568963f187
commit 7ccfa26746
2 changed files with 10 additions and 6 deletions

View file

@ -18,7 +18,7 @@ repositories {
} }
dependencies { dependencies {
compile 'com.github.turasa:signal-service-java:2.4.4_unofficial_1' compile 'com.github.turasa:signal-service-java:2.4.7_unofficial_1'
compile 'org.bouncycastle:bcprov-jdk15on:1.55' compile 'org.bouncycastle:bcprov-jdk15on:1.55'
compile 'net.sourceforge.argparse4j:argparse4j:0.7.0' compile 'net.sourceforge.argparse4j:argparse4j:0.7.0'
compile 'org.freedesktop.dbus:dbus-java:2.7.0' compile 'org.freedesktop.dbus:dbus-java:2.7.0'

View file

@ -110,6 +110,7 @@ class Manager implements Signal {
private JsonGroupStore groupStore; private JsonGroupStore groupStore;
private JsonContactsStore contactStore; private JsonContactsStore contactStore;
private JsonThreadStore threadStore; private JsonThreadStore threadStore;
private SignalServiceMessagePipe messagePipe = null;
public Manager(String username, String settingsPath) { public Manager(String username, String settingsPath) {
this.username = username; this.username = username;
@ -786,7 +787,7 @@ class Manager implements Signal {
private void sendSyncMessage(SignalServiceSyncMessage message) private void sendSyncMessage(SignalServiceSyncMessage message)
throws IOException, UntrustedIdentityException { throws IOException, UntrustedIdentityException {
SignalServiceMessageSender messageSender = new SignalServiceMessageSender(serviceUrls, username, password, SignalServiceMessageSender messageSender = new SignalServiceMessageSender(serviceUrls, username, password,
deviceId, signalProtocolStore, USER_AGENT, Optional.<SignalServiceMessageSender.EventListener>absent()); deviceId, signalProtocolStore, USER_AGENT, Optional.fromNullable(messagePipe), Optional.<SignalServiceMessageSender.EventListener>absent());
try { try {
messageSender.sendMessage(message); messageSender.sendMessage(message);
} catch (UntrustedIdentityException e) { } catch (UntrustedIdentityException e) {
@ -803,7 +804,7 @@ class Manager implements Signal {
SignalServiceDataMessage message = null; SignalServiceDataMessage message = null;
try { try {
SignalServiceMessageSender messageSender = new SignalServiceMessageSender(serviceUrls, username, password, SignalServiceMessageSender messageSender = new SignalServiceMessageSender(serviceUrls, username, password,
deviceId, signalProtocolStore, USER_AGENT, Optional.<SignalServiceMessageSender.EventListener>absent()); deviceId, signalProtocolStore, USER_AGENT, Optional.fromNullable(messagePipe), Optional.<SignalServiceMessageSender.EventListener>absent());
message = messageBuilder.build(); message = messageBuilder.build();
if (message.getGroupInfo().isPresent()) { if (message.getGroupInfo().isPresent()) {
@ -1032,10 +1033,11 @@ class Manager implements Signal {
public void receiveMessages(long timeout, TimeUnit unit, boolean returnOnTimeout, boolean ignoreAttachments, ReceiveMessageHandler handler) throws IOException { public void receiveMessages(long timeout, TimeUnit unit, boolean returnOnTimeout, boolean ignoreAttachments, ReceiveMessageHandler handler) throws IOException {
retryFailedReceivedMessages(handler, ignoreAttachments); retryFailedReceivedMessages(handler, ignoreAttachments);
final SignalServiceMessageReceiver messageReceiver = new SignalServiceMessageReceiver(serviceUrls, username, password, deviceId, signalingKey, USER_AGENT); final SignalServiceMessageReceiver messageReceiver = new SignalServiceMessageReceiver(serviceUrls, username, password, deviceId, signalingKey, USER_AGENT);
SignalServiceMessagePipe messagePipe = null;
try { try {
if (messagePipe == null) {
messagePipe = messageReceiver.createMessagePipe(); messagePipe = messageReceiver.createMessagePipe();
}
while (true) { while (true) {
SignalServiceEnvelope envelope; SignalServiceEnvelope envelope;
@ -1084,8 +1086,10 @@ class Manager implements Signal {
} }
} }
} finally { } finally {
if (messagePipe != null) if (messagePipe != null) {
messagePipe.shutdown(); messagePipe.shutdown();
messagePipe = null;
}
} }
} }