import org.asamk.signal.manager.api.SendMessageResult;
import org.asamk.signal.manager.api.SendMessageResults;
import org.asamk.signal.manager.api.TypingAction;
+import org.asamk.signal.manager.api.UnregisteredRecipientException;
import org.asamk.signal.manager.api.UpdateGroup;
import org.asamk.signal.manager.groups.GroupId;
import org.asamk.signal.manager.groups.GroupInviteLinkUrl;
throw new Error.Failure(e);
} catch (GroupNotFoundException | NotAGroupMemberException | GroupSendingNotAllowedException e) {
throw new Error.GroupNotFound(e.getMessage());
+ } catch (UnregisteredRecipientException e) {
+ throw new Error.UntrustedIdentity(e.getSender().getIdentifier() + " is not registered.");
}
}
throw new Error.Failure(e.getMessage());
} catch (GroupNotFoundException | NotAGroupMemberException | GroupSendingNotAllowedException e) {
throw new Error.GroupNotFound(e.getMessage());
+ } catch (UnregisteredRecipientException e) {
+ throw new Error.UntrustedIdentity(e.getSender().getIdentifier() + " is not registered.");
}
}
throw new Error.Failure(e.getMessage());
} catch (GroupNotFoundException | NotAGroupMemberException | GroupSendingNotAllowedException e) {
throw new Error.GroupNotFound(e.getMessage());
+ } catch (UnregisteredRecipientException e) {
+ throw new Error.UntrustedIdentity(e.getSender().getIdentifier() + " is not registered.");
}
}
@Override
public void deleteRecipient(final String recipient) throws Error.Failure {
- try {
- m.deleteRecipient(getSingleRecipientIdentifier(recipient, m.getSelfNumber()));
- } catch (IOException e) {
- throw new Error.Failure("Recipient not found");
- }
+ m.deleteRecipient(getSingleRecipientIdentifier(recipient, m.getSelfNumber()));
}
@Override
public void deleteContact(final String recipient) throws Error.Failure {
- try {
- m.deleteContact(getSingleRecipientIdentifier(recipient, m.getSelfNumber()));
- } catch (IOException e) {
- throw new Error.Failure("Contact not found");
- }
+ m.deleteContact(getSingleRecipientIdentifier(recipient, m.getSelfNumber()));
}
@Override
throw new Error.GroupNotFound(e.getMessage());
} catch (AttachmentInvalidException e) {
throw new Error.AttachmentInvalid(e.getMessage());
+ } catch (UnregisteredRecipientException e) {
+ throw new Error.UntrustedIdentity(e.getSender().getIdentifier() + " is not registered.");
}
}
throw new Error.Failure(e.getMessage());
} catch (GroupNotFoundException | NotAGroupMemberException | GroupSendingNotAllowedException e) {
throw new Error.GroupNotFound(e.getMessage());
+ } catch (UnregisteredRecipientException e) {
+ throw new Error.UntrustedIdentity(e.getSender().getIdentifier() + " is not registered.");
}
}
throw new Error.Failure("This command doesn't work on linked devices.");
} catch (IOException e) {
throw new Error.Failure("Contact is not registered.");
+ } catch (UnregisteredRecipientException e) {
+ throw new Error.UntrustedIdentity(e.getSender().getIdentifier() + " is not registered.");
}
}
m.setExpirationTimer(getSingleRecipientIdentifier(number, m.getSelfNumber()), expiration);
} catch (IOException e) {
throw new Error.Failure(e.getMessage());
+ } catch (UnregisteredRecipientException e) {
+ throw new Error.UntrustedIdentity(e.getSender().getIdentifier() + " is not registered.");
}
}
throw new Error.Failure("This command doesn't work on linked devices.");
} catch (IOException e) {
throw new Error.Failure(e.getMessage());
+ } catch (UnregisteredRecipientException e) {
+ throw new Error.UntrustedIdentity(e.getSender().getIdentifier() + " is not registered.");
}
}
throw new Error.GroupNotFound(e.getMessage());
} catch (AttachmentInvalidException e) {
throw new Error.AttachmentInvalid(e.getMessage());
+ } catch (UnregisteredRecipientException e) {
+ throw new Error.UntrustedIdentity(e.getSender().getIdentifier() + " is not registered.");
}
}
Profile profile = null;
try {
profile = m.getRecipientProfile(RecipientIdentifier.Single.fromAddress(address));
- } catch (IOException ignored) {
+ } catch (IOException | UnregisteredRecipientException ignored) {
}
if (profile != null && profile.getDisplayName().equals(name)) {
numbers.add(number);
throw new Error.GroupNotFound(e.getMessage());
} catch (IOException | LastGroupAdminException e) {
throw new Error.Failure(e.getMessage());
+ } catch (UnregisteredRecipientException e) {
+ throw new Error.UntrustedIdentity(e.getSender().getIdentifier() + " is not registered.");
}
}
throw new Error.Failure(e.getMessage());
} catch (LastGroupAdminException e) {
throw new Error.LastGroupAdmin(e.getMessage());
+ } catch (UnregisteredRecipientException e) {
+ throw new Error.UntrustedIdentity(e.getSender().getIdentifier() + " is not registered.");
}
}
throw new Error.GroupNotFound(e.getMessage());
} catch (AttachmentInvalidException e) {
throw new Error.AttachmentInvalid(e.getMessage());
+ } catch (UnregisteredRecipientException e) {
+ throw new Error.UntrustedIdentity(e.getSender().getIdentifier() + " is not registered.");
}
}
}