mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-04 05:00:39 +00:00
Merge branch 'master' into dbus_isregistered
This commit is contained in:
commit
4484b3d089
2 changed files with 27 additions and 0 deletions
|
@ -91,6 +91,10 @@ public interface Signal extends DBusInterface {
|
||||||
String name, String about, String aboutEmoji, String avatarPath, boolean removeAvatar
|
String name, String about, String aboutEmoji, String avatarPath, boolean removeAvatar
|
||||||
) throws Error.Failure;
|
) throws Error.Failure;
|
||||||
|
|
||||||
|
void removePin();
|
||||||
|
|
||||||
|
void setPin(String registrationLockPin);
|
||||||
|
|
||||||
String version();
|
String version();
|
||||||
|
|
||||||
List<String> listNumbers();
|
List<String> listNumbers();
|
||||||
|
|
|
@ -25,6 +25,7 @@ import org.whispersystems.signalservice.api.groupsv2.GroupLinkNotActiveException
|
||||||
import org.whispersystems.signalservice.api.messages.SendMessageResult;
|
import org.whispersystems.signalservice.api.messages.SendMessageResult;
|
||||||
import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException;
|
import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException;
|
||||||
import org.whispersystems.signalservice.api.util.InvalidNumberException;
|
import org.whispersystems.signalservice.api.util.InvalidNumberException;
|
||||||
|
import org.whispersystems.signalservice.internal.contacts.crypto.UnauthenticatedResponseException;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -440,6 +441,28 @@ public class DbusSignalImpl implements Signal {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removePin() {
|
||||||
|
try {
|
||||||
|
m.setRegistrationLockPin(Optional.absent());
|
||||||
|
} catch (UnauthenticatedResponseException e) {
|
||||||
|
throw new Error.Failure("Remove pin failed with unauthenticated response: " + e.getMessage());
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new Error.Failure("Remove pin error: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPin(String registrationLockPin) {
|
||||||
|
try {
|
||||||
|
m.setRegistrationLockPin(Optional.of(registrationLockPin));
|
||||||
|
} catch (UnauthenticatedResponseException e) {
|
||||||
|
throw new Error.Failure("Set pin error failed with unauthenticated response: " + e.getMessage());
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new Error.Failure("Set pin error: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Provide option to query a version string in order to react on potential
|
// Provide option to query a version string in order to react on potential
|
||||||
// future interface changes
|
// future interface changes
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue