mirror of
https://github.com/aljazceru/signal-cli.git
synced 2026-01-28 01:54:21 +01:00
Show better error message when using addDevice on a linked device
This commit is contained in:
@@ -117,7 +117,7 @@ public interface Manager extends Closeable {
|
||||
|
||||
void removeLinkedDevices(int deviceId) throws IOException;
|
||||
|
||||
void addDeviceLink(DeviceLinkUrl linkUri) throws IOException, InvalidDeviceLinkException;
|
||||
void addDeviceLink(DeviceLinkUrl linkUri) throws IOException, InvalidDeviceLinkException, NotPrimaryDeviceException;
|
||||
|
||||
void setRegistrationLockPin(Optional<String> pin) throws IOException, NotPrimaryDeviceException;
|
||||
|
||||
|
||||
@@ -362,7 +362,10 @@ public class ManagerImpl implements Manager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDeviceLink(DeviceLinkUrl linkUrl) throws IOException, InvalidDeviceLinkException {
|
||||
public void addDeviceLink(DeviceLinkUrl linkUrl) throws IOException, InvalidDeviceLinkException, NotPrimaryDeviceException {
|
||||
if (!account.isPrimaryDevice()) {
|
||||
throw new NotPrimaryDeviceException();
|
||||
}
|
||||
context.getAccountHelper().addDevice(linkUrl);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user