Reformat files

This commit is contained in:
AsamK 2026-10-06 17:50:56 +02:00
parent ba389ba6bb
commit 0dde3d8596
5 changed files with 14 additions and 27 deletions

View File

@ -288,7 +288,7 @@ public class RegistrationManagerImpl implements RegistrationManager {
throw new RecoveryRequestFailedException("Account key or recovery key is incorrect", e);
case RegisterAccountError.RateLimited ignored -> throw new RateLimitException(null);
case RegisterAccountError.PostQuantumRatchetRequired ignored ->
throw new IOException("signal-cli is too old to register this account", e);
throw new IOException("signal-cli is too old to register this account", e);
default -> throw new IOException("Signal rejected recovery-key registration", e);
}
}

View File

@ -244,10 +244,7 @@ public class DaemonCommand implements MultiLocalCommand, LocalCommand {
public abstract void runDbus(boolean isDbusSystem, final String busname) throws CommandException;
public abstract void runHttp(
InetSocketAddress address,
Duration keepAliveInterval
) throws CommandException;
public abstract void runHttp(InetSocketAddress address, Duration keepAliveInterval) throws CommandException;
protected final void runSocket(final SocketHandler socketHandler) {
socketHandler.init();
@ -303,10 +300,7 @@ public class DaemonCommand implements MultiLocalCommand, LocalCommand {
}
@Override
public void runHttp(
final InetSocketAddress address,
final Duration keepAliveInterval
) throws CommandException {
public void runHttp(final InetSocketAddress address, final Duration keepAliveInterval) throws CommandException {
runHttp(new HttpServerHandler(address, keepAliveInterval, m));
}
}
@ -331,10 +325,7 @@ public class DaemonCommand implements MultiLocalCommand, LocalCommand {
}
@Override
public void runHttp(
final InetSocketAddress address,
final Duration keepAliveInterval
) throws CommandException {
public void runHttp(final InetSocketAddress address, final Duration keepAliveInterval) throws CommandException {
runHttp(new HttpServerHandler(address, keepAliveInterval, c));
}
}

View File

@ -146,10 +146,6 @@ public class RegisterCommand implements RegistrationCommand, JsonRpcRegistration
}
public record RegistrationParams(
Boolean voice,
String captcha,
Boolean reregister,
String recoveryKey,
String totp
Boolean voice, String captcha, Boolean reregister, String recoveryKey, String totp
) {}
}

View File

@ -26,8 +26,7 @@ import java.util.stream.StreamSupport;
public class JsonRpcReader {
private static final Logger logger = LoggerFactory.getLogger(JsonRpcReader.class);
private static final int MAX_JSON_STRING_LENGTH =
((ServiceConfig.MAX_ATTACHMENT_SIZE + 2) / 3) * 4 + 1024;
private static final int MAX_JSON_STRING_LENGTH = ((ServiceConfig.MAX_ATTACHMENT_SIZE + 2) / 3) * 4 + 1024;
private final JsonRpcSender jsonRpcSender;
private final ObjectMapper objectMapper;
@ -50,9 +49,10 @@ public class JsonRpcReader {
private static ObjectMapper createObjectMapper() {
final var objectMapper = Util.createJsonObjectMapper();
objectMapper.getFactory().setStreamReadConstraints(StreamReadConstraints.builder()
.maxStringLength(MAX_JSON_STRING_LENGTH)
.build());
objectMapper.getFactory()
.setStreamReadConstraints(StreamReadConstraints.builder()
.maxStringLength(MAX_JSON_STRING_LENGTH)
.build());
return objectMapper;
}

View File

@ -64,10 +64,10 @@ public class SignalJsonRpcDispatcherHandler {
final Consumer<Manager> onManagerAddedReceiveHandler = m -> subscribeReceive(m, true);
final Consumer<Manager> onManagerRemovedReceiveHandler = this::unsubscribeReceive;
final Consumer<Manager> onManagerAddedReceiveSubscriptionsHandler = m -> receiveHandlers
.forEach((subscriptionId, handlers) -> handlers.add(createReceiveHandler(m, subscriptionId, false)));
final Consumer<Manager> onManagerAddedCallEventSubscriptionsHandler = m -> callEventHandlers
.forEach((subscriptionId, handlers) -> handlers.add(createCallEventHandler(m, subscriptionId)));
final Consumer<Manager> onManagerAddedReceiveSubscriptionsHandler = m -> receiveHandlers.forEach((subscriptionId, handlers) -> handlers.add(
createReceiveHandler(m, subscriptionId, false)));
final Consumer<Manager> onManagerAddedCallEventSubscriptionsHandler = m -> callEventHandlers.forEach((subscriptionId, handlers) -> handlers.add(
createCallEventHandler(m, subscriptionId)));
if (!noReceiveOnStart) {
this.subscribeReceive(c.getManagers(), true);