mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-03 20:50:38 +00:00
Added the isRegistered command
This commit is contained in:
parent
67f62947c6
commit
938b2a2b9d
4 changed files with 93 additions and 0 deletions
|
@ -345,6 +345,22 @@ public class Manager implements Closeable {
|
|||
return account.isRegistered();
|
||||
}
|
||||
|
||||
/**
|
||||
* This is used for checking if someone else's number is registered on Signal
|
||||
*
|
||||
* @param number The phone number in question
|
||||
* @return True if registered, false otherwise
|
||||
* @throws IOException if its unable to check if the user is registered
|
||||
*/
|
||||
public boolean isUserRegistered(String number) throws IOException {
|
||||
ContactTokenDetails details = this.accountManager.getContact(number).orNull();
|
||||
if (details == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void register(boolean voiceVerification, String captcha) throws IOException {
|
||||
account.setPassword(KeyUtils.createPassword());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue