import org.asamk.Signal;
import org.asamk.signal.AttachmentInvalidException;
+import org.asamk.signal.DbusConfig;
import org.asamk.signal.GroupNotFoundException;
import org.asamk.signal.NotAGroupMemberException;
import org.asamk.signal.StickerPackInvalidException;
SignalServiceDataMessage.Builder messageBuilder = SignalServiceDataMessage.newBuilder()
.asEndSessionMessage();
- sendMessageLegacy(messageBuilder, getSignalServiceAddresses(recipients));
+ final Collection<SignalServiceAddress> signalServiceAddresses = getSignalServiceAddresses(recipients);
+ try {
+ sendMessageLegacy(messageBuilder, signalServiceAddresses);
+ } catch (Exception e) {
+ for (SignalServiceAddress address : signalServiceAddresses) {
+ handleEndSession(address);
+ }
+ throw e;
+ }
}
@Override
if (content.isNeedsReceipt()) {
try {
sendReceipt(sender, message.getTimestamp());
- } catch (IOException | UntrustedIdentityException e) {
+ } catch (IOException | UntrustedIdentityException | IllegalArgumentException e) {
e.printStackTrace();
}
}
if (rm.isContactsRequest()) {
try {
sendContacts();
- } catch (UntrustedIdentityException | IOException e) {
+ } catch (UntrustedIdentityException | IOException | IllegalArgumentException e) {
e.printStackTrace();
}
}
if (rm.isGroupsRequest()) {
try {
sendGroups();
- } catch (UntrustedIdentityException | IOException e) {
+ } catch (UntrustedIdentityException | IOException | IllegalArgumentException e) {
e.printStackTrace();
}
}
if (rm.isBlockedListRequest()) {
try {
sendBlockedList();
- } catch (UntrustedIdentityException | IOException e) {
+ } catch (UntrustedIdentityException | IOException | IllegalArgumentException e) {
e.printStackTrace();
}
}
return false;
}
+ @Override
+ public String getObjectPath() {
+ return null;
+ }
+
private void sendGroups() throws IOException, UntrustedIdentityException {
File groupsFile = IOUtils.createTempFile();