mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Improve error message when joining a group with already pending admin approval
This commit is contained in:
parent
a708025a16
commit
489fb2ac22
6 changed files with 27 additions and 3 deletions
|
@ -9,6 +9,7 @@ import org.asamk.signal.commands.exceptions.UnexpectedErrorException;
|
|||
import org.asamk.signal.commands.exceptions.UserErrorException;
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.api.InactiveGroupLinkException;
|
||||
import org.asamk.signal.manager.api.PendingAdminApprovalException;
|
||||
import org.asamk.signal.manager.groups.GroupInviteLinkUrl;
|
||||
import org.asamk.signal.output.JsonWriter;
|
||||
import org.asamk.signal.output.OutputWriter;
|
||||
|
@ -94,6 +95,8 @@ public class JoinGroupCommand implements JsonRpcLocalCommand {
|
|||
.getSimpleName() + ")", e);
|
||||
} catch (InactiveGroupLinkException e) {
|
||||
throw new UserErrorException("Group link is not valid: " + e.getMessage());
|
||||
} catch (PendingAdminApprovalException e) {
|
||||
throw new UserErrorException("Pending admin approval: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import org.asamk.signal.manager.api.InvalidNumberException;
|
|||
import org.asamk.signal.manager.api.InvalidStickerException;
|
||||
import org.asamk.signal.manager.api.Message;
|
||||
import org.asamk.signal.manager.api.NotPrimaryDeviceException;
|
||||
import org.asamk.signal.manager.api.PendingAdminApprovalException;
|
||||
import org.asamk.signal.manager.api.RecipientIdentifier;
|
||||
import org.asamk.signal.manager.api.SendMessageResult;
|
||||
import org.asamk.signal.manager.api.SendMessageResults;
|
||||
|
@ -778,6 +779,8 @@ public class DbusSignalImpl implements Signal {
|
|||
}
|
||||
final var result = m.joinGroup(linkUrl);
|
||||
return result.first().serialize();
|
||||
} catch (PendingAdminApprovalException e) {
|
||||
throw new Error.Failure("Pending admin approval: " + e.getMessage());
|
||||
} catch (GroupInviteLinkUrl.InvalidGroupLinkException | InactiveGroupLinkException e) {
|
||||
throw new Error.Failure("Group link is invalid: " + e.getMessage());
|
||||
} catch (GroupInviteLinkUrl.UnknownGroupLinkVersionException e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue