Update dependencies

This commit is contained in:
AsamK 2020-03-30 22:00:41 +02:00
parent b68575dd16
commit e684a902bb
5 changed files with 18 additions and 15 deletions

View file

@ -20,7 +20,7 @@ repositories {
}
dependencies {
compile 'com.github.turasa:signal-service-java:2.15.3_unofficial_6'
compile 'com.github.turasa:signal-service-java:2.15.3_unofficial_7'
compile 'org.bouncycastle:bcprov-jdk15on:1.64'
compile 'net.sourceforge.argparse4j:argparse4j:0.8.1'
compile 'org.freedesktop.dbus:dbus-java:2.7.0'

View file

@ -2,6 +2,7 @@ package org.asamk.signal;
import org.whispersystems.signalservice.api.messages.SignalServiceAttachment;
import org.whispersystems.signalservice.api.messages.SignalServiceDataMessage;
import org.whispersystems.signalservice.api.messages.SignalServiceGroup;
import java.util.ArrayList;
import java.util.List;
@ -16,8 +17,9 @@ class JsonDataMessage {
JsonDataMessage(SignalServiceDataMessage dataMessage) {
this.timestamp = dataMessage.getTimestamp();
if (dataMessage.getGroupInfo().isPresent()) {
this.groupInfo = new JsonGroupInfo(dataMessage.getGroupInfo().get());
if (dataMessage.getGroupContext().isPresent() && dataMessage.getGroupContext().get().getGroupV1().isPresent()) {
SignalServiceGroup groupInfo = dataMessage.getGroupContext().get().getGroupV1().get();
this.groupInfo = new JsonGroupInfo(groupInfo);
}
if (dataMessage.getBody().isPresent()) {
this.message = dataMessage.getBody().get();

View file

@ -40,8 +40,8 @@ public class JsonDbusReceiveMessageHandler extends JsonReceiveMessageHandler {
SignalServiceDataMessage message = content.getDataMessage().get();
if (!message.isEndSession() &&
!(message.getGroupInfo().isPresent() &&
message.getGroupInfo().get().getType() != SignalServiceGroup.Type.DELIVER)) {
!(message.getGroupContext().isPresent() &&
message.getGroupContext().get().getGroupV1Type() != SignalServiceGroup.Type.DELIVER)) {
List<String> attachments = new ArrayList<>();
if (message.getAttachments().isPresent()) {
for (SignalServiceAttachment attachment : message.getAttachments().get()) {
@ -56,7 +56,8 @@ public class JsonDbusReceiveMessageHandler extends JsonReceiveMessageHandler {
objectPath,
message.getTimestamp(),
envelope.isUnidentifiedSender() || !envelope.hasSource() ? content.getSender().getNumber().get() : envelope.getSourceE164().get(),
message.getGroupInfo().isPresent() ? message.getGroupInfo().get().getGroupId() : new byte[0],
message.getGroupContext().isPresent() && message.getGroupContext().get().getGroupV1().isPresent()
? message.getGroupContext().get().getGroupV1().get().getGroupId() : new byte[0],
message.getBody().isPresent() ? message.getBody().get() : "",
attachments));
} catch (DBusException e) {

View file

@ -254,8 +254,8 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
if (message.getBody().isPresent()) {
System.out.println("Body: " + message.getBody().get());
}
if (message.getGroupInfo().isPresent()) {
SignalServiceGroup groupInfo = message.getGroupInfo().get();
if (message.getGroupContext().isPresent() && message.getGroupContext().get().getGroupV1().isPresent()) {
SignalServiceGroup groupInfo = message.getGroupContext().get().getGroupV1().get();
System.out.println("Group info:");
System.out.println(" Id: " + Base64.encodeBytes(groupInfo.getGroupId()));
if (groupInfo.getType() == SignalServiceGroup.Type.UPDATE && groupInfo.getName().isPresent()) {

View file

@ -1177,7 +1177,7 @@ public class Manager implements Signal {
SignalServiceMessageSender messageSender = getMessageSender();
message = messageBuilder.build();
if (message.getGroupInfo().isPresent()) {
if (message.getGroupContext().isPresent()) {
try {
final boolean isRecipientUpdate = false;
List<SendMessageResult> result = messageSender.sendMessage(new ArrayList<>(recipients), getAccessFor(recipients), isRecipientUpdate, message);
@ -1262,8 +1262,8 @@ public class Manager implements Signal {
}
private void handleSignalServiceDataMessage(SignalServiceDataMessage message, boolean isSync, SignalServiceAddress source, SignalServiceAddress destination, boolean ignoreAttachments) {
if (message.getGroupInfo().isPresent()) {
SignalServiceGroup groupInfo = message.getGroupInfo().get();
if (message.getGroupContext().isPresent() && message.getGroupContext().get().getGroupV1().isPresent()) {
SignalServiceGroup groupInfo = message.getGroupContext().get().getGroupV1().get();
GroupInfo group = account.getGroupStore().getGroup(groupInfo.getGroupId());
switch (groupInfo.getType()) {
case UPDATE:
@ -1330,8 +1330,8 @@ public class Manager implements Signal {
handleEndSession(isSync ? destination : source);
}
if (message.isExpirationUpdate() || message.getBody().isPresent()) {
if (message.getGroupInfo().isPresent()) {
SignalServiceGroup groupInfo = message.getGroupInfo().get();
if (message.getGroupContext().isPresent() && message.getGroupContext().get().getGroupV1().isPresent()) {
SignalServiceGroup groupInfo = message.getGroupContext().get().getGroupV1().get();
GroupInfo group = account.getGroupStore().getGroup(groupInfo.getGroupId());
if (group == null) {
group = new GroupInfo(groupInfo.getGroupId());
@ -1528,8 +1528,8 @@ public class Manager implements Signal {
if (content != null && content.getDataMessage().isPresent()) {
SignalServiceDataMessage message = content.getDataMessage().get();
if (message.getGroupInfo().isPresent()) {
SignalServiceGroup groupInfo = message.getGroupInfo().get();
if (message.getGroupContext().isPresent() && message.getGroupContext().get().getGroupV1().isPresent()) {
SignalServiceGroup groupInfo = message.getGroupContext().get().getGroupV1().get();
GroupInfo group = getGroup(groupInfo.getGroupId());
if (groupInfo.getType() == SignalServiceGroup.Type.DELIVER && group != null && group.blocked) {
return true;