Revert delete account conversion to WebSocket.

This commit is contained in:
Cody Henthorne
2025-03-12 16:13:50 -04:00
committed by Greyson Parrelli
parent 6d956ca0f9
commit ddda5e8b47
3 changed files with 11 additions and 3 deletions

View File

@@ -16,9 +16,7 @@ import org.thoughtcrime.securesms.database.model.GroupRecord;
import org.thoughtcrime.securesms.database.model.InAppPaymentSubscriberRecord;
import org.thoughtcrime.securesms.dependencies.AppDependencies;
import org.thoughtcrime.securesms.groups.GroupManager;
import org.thoughtcrime.securesms.net.SignalNetwork;
import org.thoughtcrime.securesms.util.ServiceUtil;
import org.whispersystems.signalservice.api.NetworkResultUtil;
import org.whispersystems.signalservice.internal.EmptyResponse;
import org.whispersystems.signalservice.internal.ServiceResponse;
@@ -105,7 +103,7 @@ class DeleteAccountRepository {
Log.i(TAG, "deleteAccount: attempting to delete account from server...");
try {
NetworkResultUtil.toBasicLegacy(SignalNetwork.account().deleteAccount());
AppDependencies.getSignalServiceAccountManager().deleteAccount();
} catch (IOException e) {
Log.w(TAG, "deleteAccount: failed to delete account from signal service", e);
onDeleteAccountEvent.accept(DeleteAccountEvent.ServerDeletionFailed.INSTANCE);

View File

@@ -124,6 +124,10 @@ public class SignalServiceAccountManager {
return NetworkResultUtil.toBasicLegacy(accountApi.whoAmI());
}
public void deleteAccount() throws IOException {
this.pushServiceSocket.deleteAccount();
}
/**
* Request a push challenge. A number will be pushed to the GCM (FCM) id. This can then be used
* during SMS/call requests to bypass the CAPTCHA.

View File

@@ -191,6 +191,8 @@ public class PushServiceSocket {
private static final String TAG = PushServiceSocket.class.getSimpleName();
private static final String DELETE_ACCOUNT_PATH = "/v1/accounts/me";
private static final String PREKEY_METADATA_PATH = "/v2/keys?identity=%s";
private static final String PREKEY_PATH = "/v2/keys?identity=%s";
private static final String PREKEY_DEVICE_PATH = "/v2/keys/%s/%s";
@@ -912,6 +914,10 @@ public class PushServiceSocket {
return JsonUtil.fromJson(response, BackupV3AuthCheckResponse.class);
}
public void deleteAccount() throws IOException {
makeServiceRequest(DELETE_ACCOUNT_PATH, "DELETE", null);
}
public void redeemDonationReceipt(ReceiptCredentialPresentation receiptCredentialPresentation, boolean visible, boolean primary) throws IOException {
String payload = JsonUtil.toJson(new RedeemDonationReceiptRequest(Base64.encodeWithPadding(receiptCredentialPresentation.serialize()), visible, primary));
makeServiceRequest(DONATION_REDEEM_RECEIPT, "POST", payload);