mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Update dependencies
This commit is contained in:
parent
b68575dd16
commit
e684a902bb
5 changed files with 18 additions and 15 deletions
|
@ -20,7 +20,7 @@ repositories {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
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 'org.bouncycastle:bcprov-jdk15on:1.64'
|
||||||
compile 'net.sourceforge.argparse4j:argparse4j:0.8.1'
|
compile 'net.sourceforge.argparse4j:argparse4j:0.8.1'
|
||||||
compile 'org.freedesktop.dbus:dbus-java:2.7.0'
|
compile 'org.freedesktop.dbus:dbus-java:2.7.0'
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.asamk.signal;
|
||||||
|
|
||||||
import org.whispersystems.signalservice.api.messages.SignalServiceAttachment;
|
import org.whispersystems.signalservice.api.messages.SignalServiceAttachment;
|
||||||
import org.whispersystems.signalservice.api.messages.SignalServiceDataMessage;
|
import org.whispersystems.signalservice.api.messages.SignalServiceDataMessage;
|
||||||
|
import org.whispersystems.signalservice.api.messages.SignalServiceGroup;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -16,8 +17,9 @@ class JsonDataMessage {
|
||||||
|
|
||||||
JsonDataMessage(SignalServiceDataMessage dataMessage) {
|
JsonDataMessage(SignalServiceDataMessage dataMessage) {
|
||||||
this.timestamp = dataMessage.getTimestamp();
|
this.timestamp = dataMessage.getTimestamp();
|
||||||
if (dataMessage.getGroupInfo().isPresent()) {
|
if (dataMessage.getGroupContext().isPresent() && dataMessage.getGroupContext().get().getGroupV1().isPresent()) {
|
||||||
this.groupInfo = new JsonGroupInfo(dataMessage.getGroupInfo().get());
|
SignalServiceGroup groupInfo = dataMessage.getGroupContext().get().getGroupV1().get();
|
||||||
|
this.groupInfo = new JsonGroupInfo(groupInfo);
|
||||||
}
|
}
|
||||||
if (dataMessage.getBody().isPresent()) {
|
if (dataMessage.getBody().isPresent()) {
|
||||||
this.message = dataMessage.getBody().get();
|
this.message = dataMessage.getBody().get();
|
||||||
|
|
|
@ -40,8 +40,8 @@ public class JsonDbusReceiveMessageHandler extends JsonReceiveMessageHandler {
|
||||||
SignalServiceDataMessage message = content.getDataMessage().get();
|
SignalServiceDataMessage message = content.getDataMessage().get();
|
||||||
|
|
||||||
if (!message.isEndSession() &&
|
if (!message.isEndSession() &&
|
||||||
!(message.getGroupInfo().isPresent() &&
|
!(message.getGroupContext().isPresent() &&
|
||||||
message.getGroupInfo().get().getType() != SignalServiceGroup.Type.DELIVER)) {
|
message.getGroupContext().get().getGroupV1Type() != SignalServiceGroup.Type.DELIVER)) {
|
||||||
List<String> attachments = new ArrayList<>();
|
List<String> attachments = new ArrayList<>();
|
||||||
if (message.getAttachments().isPresent()) {
|
if (message.getAttachments().isPresent()) {
|
||||||
for (SignalServiceAttachment attachment : message.getAttachments().get()) {
|
for (SignalServiceAttachment attachment : message.getAttachments().get()) {
|
||||||
|
@ -56,7 +56,8 @@ public class JsonDbusReceiveMessageHandler extends JsonReceiveMessageHandler {
|
||||||
objectPath,
|
objectPath,
|
||||||
message.getTimestamp(),
|
message.getTimestamp(),
|
||||||
envelope.isUnidentifiedSender() || !envelope.hasSource() ? content.getSender().getNumber().get() : envelope.getSourceE164().get(),
|
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() : "",
|
message.getBody().isPresent() ? message.getBody().get() : "",
|
||||||
attachments));
|
attachments));
|
||||||
} catch (DBusException e) {
|
} catch (DBusException e) {
|
||||||
|
|
|
@ -254,8 +254,8 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
|
||||||
if (message.getBody().isPresent()) {
|
if (message.getBody().isPresent()) {
|
||||||
System.out.println("Body: " + message.getBody().get());
|
System.out.println("Body: " + message.getBody().get());
|
||||||
}
|
}
|
||||||
if (message.getGroupInfo().isPresent()) {
|
if (message.getGroupContext().isPresent() && message.getGroupContext().get().getGroupV1().isPresent()) {
|
||||||
SignalServiceGroup groupInfo = message.getGroupInfo().get();
|
SignalServiceGroup groupInfo = message.getGroupContext().get().getGroupV1().get();
|
||||||
System.out.println("Group info:");
|
System.out.println("Group info:");
|
||||||
System.out.println(" Id: " + Base64.encodeBytes(groupInfo.getGroupId()));
|
System.out.println(" Id: " + Base64.encodeBytes(groupInfo.getGroupId()));
|
||||||
if (groupInfo.getType() == SignalServiceGroup.Type.UPDATE && groupInfo.getName().isPresent()) {
|
if (groupInfo.getType() == SignalServiceGroup.Type.UPDATE && groupInfo.getName().isPresent()) {
|
||||||
|
|
|
@ -1177,7 +1177,7 @@ public class Manager implements Signal {
|
||||||
SignalServiceMessageSender messageSender = getMessageSender();
|
SignalServiceMessageSender messageSender = getMessageSender();
|
||||||
|
|
||||||
message = messageBuilder.build();
|
message = messageBuilder.build();
|
||||||
if (message.getGroupInfo().isPresent()) {
|
if (message.getGroupContext().isPresent()) {
|
||||||
try {
|
try {
|
||||||
final boolean isRecipientUpdate = false;
|
final boolean isRecipientUpdate = false;
|
||||||
List<SendMessageResult> result = messageSender.sendMessage(new ArrayList<>(recipients), getAccessFor(recipients), isRecipientUpdate, message);
|
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) {
|
private void handleSignalServiceDataMessage(SignalServiceDataMessage message, boolean isSync, SignalServiceAddress source, SignalServiceAddress destination, boolean ignoreAttachments) {
|
||||||
if (message.getGroupInfo().isPresent()) {
|
if (message.getGroupContext().isPresent() && message.getGroupContext().get().getGroupV1().isPresent()) {
|
||||||
SignalServiceGroup groupInfo = message.getGroupInfo().get();
|
SignalServiceGroup groupInfo = message.getGroupContext().get().getGroupV1().get();
|
||||||
GroupInfo group = account.getGroupStore().getGroup(groupInfo.getGroupId());
|
GroupInfo group = account.getGroupStore().getGroup(groupInfo.getGroupId());
|
||||||
switch (groupInfo.getType()) {
|
switch (groupInfo.getType()) {
|
||||||
case UPDATE:
|
case UPDATE:
|
||||||
|
@ -1330,8 +1330,8 @@ public class Manager implements Signal {
|
||||||
handleEndSession(isSync ? destination : source);
|
handleEndSession(isSync ? destination : source);
|
||||||
}
|
}
|
||||||
if (message.isExpirationUpdate() || message.getBody().isPresent()) {
|
if (message.isExpirationUpdate() || message.getBody().isPresent()) {
|
||||||
if (message.getGroupInfo().isPresent()) {
|
if (message.getGroupContext().isPresent() && message.getGroupContext().get().getGroupV1().isPresent()) {
|
||||||
SignalServiceGroup groupInfo = message.getGroupInfo().get();
|
SignalServiceGroup groupInfo = message.getGroupContext().get().getGroupV1().get();
|
||||||
GroupInfo group = account.getGroupStore().getGroup(groupInfo.getGroupId());
|
GroupInfo group = account.getGroupStore().getGroup(groupInfo.getGroupId());
|
||||||
if (group == null) {
|
if (group == null) {
|
||||||
group = new GroupInfo(groupInfo.getGroupId());
|
group = new GroupInfo(groupInfo.getGroupId());
|
||||||
|
@ -1528,8 +1528,8 @@ public class Manager implements Signal {
|
||||||
|
|
||||||
if (content != null && content.getDataMessage().isPresent()) {
|
if (content != null && content.getDataMessage().isPresent()) {
|
||||||
SignalServiceDataMessage message = content.getDataMessage().get();
|
SignalServiceDataMessage message = content.getDataMessage().get();
|
||||||
if (message.getGroupInfo().isPresent()) {
|
if (message.getGroupContext().isPresent() && message.getGroupContext().get().getGroupV1().isPresent()) {
|
||||||
SignalServiceGroup groupInfo = message.getGroupInfo().get();
|
SignalServiceGroup groupInfo = message.getGroupContext().get().getGroupV1().get();
|
||||||
GroupInfo group = getGroup(groupInfo.getGroupId());
|
GroupInfo group = getGroup(groupInfo.getGroupId());
|
||||||
if (groupInfo.getType() == SignalServiceGroup.Type.DELIVER && group != null && group.blocked) {
|
if (groupInfo.getType() == SignalServiceGroup.Type.DELIVER && group != null && group.blocked) {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue