Cleanup manager package

This commit is contained in:
AsamK 2022-02-06 17:21:39 +01:00
parent 3040da99c4
commit 5cccf52103
55 changed files with 190 additions and 160 deletions

View file

@ -2,10 +2,9 @@ package org.asamk.signal.dbus;
import org.asamk.Signal;
import org.asamk.signal.DbusConfig;
import org.asamk.signal.manager.AttachmentInvalidException;
import org.asamk.signal.manager.Manager;
import org.asamk.signal.manager.NotMasterDeviceException;
import org.asamk.signal.manager.StickerPackInvalidException;
import org.asamk.signal.manager.api.StickerPackInvalidException;
import org.asamk.signal.manager.api.AttachmentInvalidException;
import org.asamk.signal.manager.api.Configuration;
import org.asamk.signal.manager.api.Device;
import org.asamk.signal.manager.api.Group;
@ -14,6 +13,7 @@ import org.asamk.signal.manager.api.InactiveGroupLinkException;
import org.asamk.signal.manager.api.InvalidDeviceLinkException;
import org.asamk.signal.manager.api.Message;
import org.asamk.signal.manager.api.MessageEnvelope;
import org.asamk.signal.manager.api.NotMasterDeviceException;
import org.asamk.signal.manager.api.Pair;
import org.asamk.signal.manager.api.RecipientIdentifier;
import org.asamk.signal.manager.api.SendGroupMessageResults;
@ -84,11 +84,6 @@ public class DbusManagerImpl implements Manager {
return signal.getSelfNumber();
}
@Override
public void checkAccountState() throws IOException {
throw new UnsupportedOperationException();
}
@Override
public Map<String, Pair<String, UUID>> areUsersRegistered(final Set<String> numbers) throws IOException {
final var numbersList = new ArrayList<>(numbers);

View file

@ -2,7 +2,7 @@ package org.asamk.signal.dbus;
import org.asamk.SignalControl;
import org.asamk.signal.manager.ProvisioningManager;
import org.asamk.signal.manager.UserAlreadyExists;
import org.asamk.signal.manager.api.UserAlreadyExistsException;
import org.freedesktop.dbus.connections.impl.DBusConnection;
import java.io.IOException;
@ -27,9 +27,7 @@ public class DbusProvisioningManagerImpl implements ProvisioningManager {
}
public DbusProvisioningManagerImpl(
final SignalControl signalControl,
DBusConnection connection,
URI deviceLinkUri
final SignalControl signalControl, DBusConnection connection, URI deviceLinkUri
) {
this.signalControl = signalControl;
this.connection = connection;
@ -47,7 +45,7 @@ public class DbusProvisioningManagerImpl implements ProvisioningManager {
}
@Override
public String finishDeviceLink(final String deviceName) throws IOException, TimeoutException, UserAlreadyExists {
public String finishDeviceLink(final String deviceName) throws IOException, TimeoutException, UserAlreadyExistsException {
return signalControl.finishLink(deviceLinkUri.toString(), deviceName);
}
}

View file

@ -7,7 +7,7 @@ import org.asamk.signal.manager.Manager;
import org.asamk.signal.manager.MultiAccountManager;
import org.asamk.signal.manager.ProvisioningManager;
import org.asamk.signal.manager.RegistrationManager;
import org.asamk.signal.manager.UserAlreadyExists;
import org.asamk.signal.manager.api.UserAlreadyExistsException;
import org.asamk.signal.manager.api.CaptchaRequiredException;
import org.asamk.signal.manager.api.IncorrectPinException;
import org.asamk.signal.manager.api.PinLockedException;
@ -100,7 +100,7 @@ public class DbusSignalControlImpl implements org.asamk.SignalControl {
final ProvisioningManager provisioningManager = c.getProvisioningManagerFor(deviceLinkUri);
try {
provisioningManager.finishDeviceLink(newDeviceName);
} catch (IOException | TimeoutException | UserAlreadyExists e) {
} catch (IOException | TimeoutException | UserAlreadyExistsException e) {
e.printStackTrace();
}
});
@ -127,7 +127,7 @@ public class DbusSignalControlImpl implements org.asamk.SignalControl {
try {
final var provisioningManager = c.getProvisioningManagerFor(new URI(deviceLinkUri));
return provisioningManager.finishDeviceLink(newDeviceName);
} catch (TimeoutException | IOException | UserAlreadyExists | URISyntaxException e) {
} catch (TimeoutException | IOException | UserAlreadyExistsException | URISyntaxException e) {
throw new SignalControl.Error.Failure(e.getClass().getSimpleName() + " " + e.getMessage());
}
}

View file

@ -2,16 +2,16 @@ package org.asamk.signal.dbus;
import org.asamk.Signal;
import org.asamk.signal.BaseConfig;
import org.asamk.signal.manager.AttachmentInvalidException;
import org.asamk.signal.manager.Manager;
import org.asamk.signal.manager.NotMasterDeviceException;
import org.asamk.signal.manager.StickerPackInvalidException;
import org.asamk.signal.manager.api.StickerPackInvalidException;
import org.asamk.signal.manager.api.AttachmentInvalidException;
import org.asamk.signal.manager.api.Identity;
import org.asamk.signal.manager.api.InactiveGroupLinkException;
import org.asamk.signal.manager.api.InvalidDeviceLinkException;
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.NotMasterDeviceException;
import org.asamk.signal.manager.api.Pair;
import org.asamk.signal.manager.api.RecipientIdentifier;
import org.asamk.signal.manager.api.SendMessageResult;