mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 00:29:11 +01:00
Revert "Prevent changes to conversations while device is unregistered."
This reverts commit ed8edb5aee.
This commit is contained in:
@@ -70,10 +70,6 @@ public class PipeConnectivityListener implements ConnectivityListener {
|
||||
Log.w(TAG, "Encountered an error while we had a proxy set! Terminating the connection to prevent retry spam.");
|
||||
ApplicationDependencies.closeConnections();
|
||||
return false;
|
||||
} else if (TextSecurePreferences.isUnauthorizedRecieved(ApplicationDependencies.getApplication())) {
|
||||
Log.w(TAG, "Encountered an error while unregistered! Terminating the connection to prevent retry spam.");
|
||||
ApplicationDependencies.closeConnections();
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package org.thoughtcrime.securesms.net;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.whispersystems.signalservice.internal.push.PushServiceSocket;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import okhttp3.Interceptor;
|
||||
import okhttp3.Protocol;
|
||||
import okhttp3.Response;
|
||||
import okhttp3.ResponseBody;
|
||||
|
||||
/**
|
||||
* Blocks network access when device is unregistered.
|
||||
*/
|
||||
public final class UnregisteredBlockingInterceptor implements Interceptor {
|
||||
|
||||
private static final String TAG = Log.tag(UnregisteredBlockingInterceptor.class);
|
||||
|
||||
@Override
|
||||
public @NonNull Response intercept(@NonNull Chain chain) throws IOException {
|
||||
if (TextSecurePreferences.isUnauthorizedRecieved(ApplicationDependencies.getApplication()) &&
|
||||
PushServiceSocket.isNotRegistrationPath(chain.request().url().encodedPath()))
|
||||
{
|
||||
Log.w(TAG, "Preventing request because device is unregistered.");
|
||||
return new Response.Builder().request(chain.request())
|
||||
.protocol(Protocol.HTTP_1_1)
|
||||
.receivedResponseAtMillis(System.currentTimeMillis())
|
||||
.message("")
|
||||
.body(ResponseBody.create(null, ""))
|
||||
.code(508)
|
||||
.build();
|
||||
}
|
||||
|
||||
return chain.proceed(chain.request());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user