Add ability to delete your Signal account from within the app.

This commit is contained in:
Alex Hart
2020-12-07 17:39:16 -04:00
committed by GitHub
parent 00b6416583
commit edb2a17bcb
21 changed files with 1019 additions and 23 deletions

View File

@@ -682,6 +682,10 @@ public class SignalServiceAccountManager {
this.pushServiceSocket.deleteUsername();
}
public void deleteAccount() throws IOException {
this.pushServiceSocket.deleteAccount();
}
public void setSoTimeoutMillis(long soTimeoutMillis) {
this.pushServiceSocket.setSoTimeoutMillis(soTimeoutMillis);
}

View File

@@ -164,6 +164,7 @@ public class PushServiceSocket {
private static final String WHO_AM_I = "/v1/accounts/whoami";
private static final String SET_USERNAME_PATH = "/v1/accounts/username/%s";
private static final String DELETE_USERNAME_PATH = "/v1/accounts/username";
private static final String DELETE_ACCOUNT_PATH = "/v1/accounts/me";
private static final String PREKEY_METADATA_PATH = "/v2/keys/";
private static final String PREKEY_PATH = "/v2/keys/%s";
@@ -749,6 +750,10 @@ public class PushServiceSocket {
makeServiceRequest(DELETE_USERNAME_PATH, "DELETE", null);
}
public void deleteAccount() throws IOException {
makeServiceRequest(DELETE_ACCOUNT_PATH, "DELETE", null);
}
public List<ContactTokenDetails> retrieveDirectory(Set<String> contactTokens)
throws NonSuccessfulResponseCodeException, PushNetworkException
{