import org.asamk.signal.manager.groups.GroupId;
import org.asamk.signal.manager.groups.GroupInviteLinkUrl;
import org.asamk.signal.manager.groups.GroupNotFoundException;
+import org.asamk.signal.manager.groups.GroupSendingNotAllowedException;
import org.asamk.signal.manager.groups.LastGroupAdminException;
import org.asamk.signal.manager.groups.NotAGroupMemberException;
import org.asamk.signal.manager.storage.identities.IdentityInfo;
import org.whispersystems.libsignal.util.guava.Optional;
import org.whispersystems.signalservice.api.groupsv2.GroupLinkNotActiveException;
import org.whispersystems.signalservice.api.messages.SendMessageResult;
+import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException;
import org.whispersystems.signalservice.api.util.InvalidNumberException;
import java.io.File;
throw new Error.AttachmentInvalid(e.getMessage());
} catch (IOException e) {
throw new Error.Failure(e.getMessage());
- } catch (GroupNotFoundException | NotAGroupMemberException e) {
+ } catch (GroupNotFoundException | NotAGroupMemberException | GroupSendingNotAllowedException e) {
throw new Error.GroupNotFound(e.getMessage());
}
}
return results.getTimestamp();
} catch (IOException e) {
throw new Error.Failure(e.getMessage());
- } catch (GroupNotFoundException | NotAGroupMemberException e) {
+ } catch (GroupNotFoundException | NotAGroupMemberException | GroupSendingNotAllowedException e) {
throw new Error.GroupNotFound(e.getMessage());
}
}
return results.getTimestamp();
} catch (IOException e) {
throw new Error.Failure(e.getMessage());
- } catch (GroupNotFoundException | NotAGroupMemberException e) {
+ } catch (GroupNotFoundException | NotAGroupMemberException | GroupSendingNotAllowedException e) {
throw new Error.GroupNotFound(e.getMessage());
}
}
return results.getTimestamp();
} catch (IOException e) {
throw new Error.Failure(e.getMessage());
- } catch (GroupNotFoundException | NotAGroupMemberException e) {
+ } catch (GroupNotFoundException | NotAGroupMemberException | GroupSendingNotAllowedException e) {
throw new Error.GroupNotFound(e.getMessage());
}
}
throw new Error.AttachmentInvalid(e.getMessage());
} catch (IOException e) {
throw new Error.Failure(e.getMessage());
- } catch (GroupNotFoundException | NotAGroupMemberException e) {
+ } catch (GroupNotFoundException | NotAGroupMemberException | GroupSendingNotAllowedException e) {
throw new Error.GroupNotFound(e.getMessage());
}
}
return results.getTimestamp();
} catch (IOException e) {
throw new Error.Failure(e.getMessage());
- } catch (GroupNotFoundException | NotAGroupMemberException e) {
+ } catch (GroupNotFoundException | NotAGroupMemberException | GroupSendingNotAllowedException e) {
throw new Error.GroupNotFound(e.getMessage());
} catch (AttachmentInvalidException e) {
throw new Error.AttachmentInvalid(e.getMessage());
return results.getTimestamp();
} catch (IOException e) {
throw new Error.Failure(e.getMessage());
- } catch (GroupNotFoundException | NotAGroupMemberException e) {
+ } catch (GroupNotFoundException | NotAGroupMemberException | GroupSendingNotAllowedException e) {
throw new Error.GroupNotFound(e.getMessage());
}
}
m.setContactName(getSingleRecipientIdentifier(number, m.getUsername()), name);
} catch (NotMasterDeviceException e) {
throw new Error.Failure("This command doesn't work on linked devices.");
+ } catch (UnregisteredUserException e) {
+ throw new Error.Failure("Contact is not registered.");
}
}
m.setContactBlocked(getSingleRecipientIdentifier(number, m.getUsername()), blocked);
} catch (NotMasterDeviceException e) {
throw new Error.Failure("This command doesn't work on linked devices.");
+ } catch (IOException e) {
+ throw new Error.Failure(e.getMessage());
}
}
m.setGroupBlocked(getGroupId(groupId), blocked);
} catch (GroupNotFoundException e) {
throw new Error.GroupNotFound(e.getMessage());
+ } catch (IOException e) {
+ throw new Error.Failure(e.getMessage());
}
}
}
} catch (IOException e) {
throw new Error.Failure(e.getMessage());
- } catch (GroupNotFoundException | NotAGroupMemberException e) {
+ } catch (GroupNotFoundException | NotAGroupMemberException | GroupSendingNotAllowedException e) {
throw new Error.GroupNotFound(e.getMessage());
} catch (AttachmentInvalidException e) {
throw new Error.AttachmentInvalid(e.getMessage());
public void quitGroup(final byte[] groupId) {
var group = getGroupId(groupId);
try {
- m.sendQuitGroupMessage(group, Set.of());
+ m.quitGroup(group, Set.of());
} catch (GroupNotFoundException | NotAGroupMemberException e) {
throw new Error.GroupNotFound(e.getMessage());
} catch (IOException | LastGroupAdminException e) {