Commit 24bf24d6 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Removed unused imports and RxWebSocketCallback Failure class

parent 40a217f0
......@@ -378,12 +378,10 @@ public class DDPClientImpl {
private void sendMessage(String msg, @Nullable JSONBuilder json,
TaskCompletionSource<?> taskForSetError) {
if (!sendMessage(msg, json)) {
if (taskForSetError != null) {
if (!sendMessage(msg, json) && taskForSetError != null) {
taskForSetError.trySetError(new DDPClientCallback.Closed(client));
}
}
}
private void addErrorCallback(CompositeDisposable disposables, TaskCompletionSource<?> task) {
disposables.add(
......
package chat.rocket.android_ddp.rx;
import static android.R.attr.resizeable;
import static android.R.attr.type;
import chat.rocket.android.log.RCLog;
import okhttp3.Response;
import okhttp3.WebSocket;
......@@ -35,27 +32,6 @@ public class RxWebSocketCallback {
}
}
public static class Failure extends Base {
public Response response;
public Failure(WebSocket websocket, Throwable err, Response response) {
super("Failure", websocket);
this.response = response;
if (response != null && response.body() != null) {
this.response.body().close();
}
}
@Override
public String toString() {
if (response != null) {
return "[" + type + "] " + response.message();
} else {
return super.toString();
}
}
}
public static class Message extends Base {
public String responseBodyString;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment