Commit 7683da05 authored by Tiago Cunha's avatar Tiago Cunha Committed by Yusuke Iwaki

Renamed classes (fix typo)

parent 9c34af88
...@@ -17,11 +17,11 @@ import rx.Observable; ...@@ -17,11 +17,11 @@ import rx.Observable;
/** /**
* DDP client wrapper. * DDP client wrapper.
*/ */
public class DDPClientWraper { public class DDPClientWrapper {
private final DDPClient ddpClient; private final DDPClient ddpClient;
private final String hostname; private final String hostname;
private DDPClientWraper(String hostname) { private DDPClientWrapper(String hostname) {
ddpClient = new DDPClient(OkHttpHelper.getClientForWebSocket()); ddpClient = new DDPClient(OkHttpHelper.getClientForWebSocket());
this.hostname = hostname; this.hostname = hostname;
} }
...@@ -29,8 +29,8 @@ public class DDPClientWraper { ...@@ -29,8 +29,8 @@ public class DDPClientWraper {
/** /**
* create new API client instance. * create new API client instance.
*/ */
public static DDPClientWraper create(String hostname) { public static DDPClientWrapper create(String hostname) {
return new DDPClientWraper(hostname); return new DDPClientWrapper(hostname);
} }
/** /**
......
...@@ -16,7 +16,7 @@ public class FileUploadingHelper extends MethodCallHelper { ...@@ -16,7 +16,7 @@ public class FileUploadingHelper extends MethodCallHelper {
super(context, serverConfigId); super(context, serverConfigId);
} }
public FileUploadingHelper(RealmHelper realmHelper, DDPClientWraper ddpClient) { public FileUploadingHelper(RealmHelper realmHelper, DDPClientWrapper ddpClient) {
super(realmHelper, ddpClient); super(realmHelper, ddpClient);
} }
......
...@@ -35,7 +35,7 @@ public class MethodCallHelper { ...@@ -35,7 +35,7 @@ public class MethodCallHelper {
task -> Task.forResult(new JSONArray(task.getResult())); task -> Task.forResult(new JSONArray(task.getResult()));
protected final Context context; protected final Context context;
protected final RealmHelper realmHelper; protected final RealmHelper realmHelper;
protected final DDPClientWraper ddpClient; protected final DDPClientWrapper ddpClient;
@Deprecated @Deprecated
/** /**
...@@ -57,7 +57,7 @@ public class MethodCallHelper { ...@@ -57,7 +57,7 @@ public class MethodCallHelper {
/** /**
* initialize with RealmHelper and DDPClient. * initialize with RealmHelper and DDPClient.
*/ */
public MethodCallHelper(RealmHelper realmHelper, DDPClientWraper ddpClient) { public MethodCallHelper(RealmHelper realmHelper, DDPClientWrapper ddpClient) {
this.context = null; this.context = null;
this.realmHelper = realmHelper; this.realmHelper = realmHelper;
this.ddpClient = ddpClient; this.ddpClient = ddpClient;
......
...@@ -3,7 +3,7 @@ package chat.rocket.android.service; ...@@ -3,7 +3,7 @@ package chat.rocket.android.service;
/** /**
* interface for observer and ddp_subscription. * interface for observer and ddp_subscription.
*/ */
public interface Registerable { public interface Registrable {
/** /**
* register. * register.
*/ */
......
...@@ -11,7 +11,7 @@ import java.util.Iterator; ...@@ -11,7 +11,7 @@ import java.util.Iterator;
import bolts.Continuation; import bolts.Continuation;
import bolts.Task; import bolts.Task;
import bolts.TaskCompletionSource; import bolts.TaskCompletionSource;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogcatIfError;
import chat.rocket.android.helper.TextUtils; import chat.rocket.android.helper.TextUtils;
import chat.rocket.android.log.RCLog; import chat.rocket.android.log.RCLog;
...@@ -60,8 +60,8 @@ public class RocketChatWebSocketThread extends HandlerThread { ...@@ -60,8 +60,8 @@ public class RocketChatWebSocketThread extends HandlerThread {
private final String serverConfigId; private final String serverConfigId;
private final RealmHelper defaultRealm; private final RealmHelper defaultRealm;
private final RealmHelper serverConfigRealm; private final RealmHelper serverConfigRealm;
private final ArrayList<Registerable> listeners = new ArrayList<>(); private final ArrayList<Registrable> listeners = new ArrayList<>();
private DDPClientWraper ddpClient; private DDPClientWrapper ddpClient;
private boolean listenersRegistered; private boolean listenersRegistered;
private RocketChatWebSocketThread(Context appContext, String serverConfigId) { private RocketChatWebSocketThread(Context appContext, String serverConfigId) {
...@@ -157,7 +157,7 @@ public class RocketChatWebSocketThread extends HandlerThread { ...@@ -157,7 +157,7 @@ public class RocketChatWebSocketThread extends HandlerThread {
private void prepareWebSocket(String hostname) { private void prepareWebSocket(String hostname) {
if (ddpClient == null || !ddpClient.isConnected()) { if (ddpClient == null || !ddpClient.isConnected()) {
ddpClient = DDPClientWraper.create(hostname); ddpClient = DDPClientWrapper.create(hostname);
} }
} }
...@@ -233,11 +233,11 @@ public class RocketChatWebSocketThread extends HandlerThread { ...@@ -233,11 +233,11 @@ public class RocketChatWebSocketThread extends HandlerThread {
for (Class clazz : REGISTERABLE_CLASSES) { for (Class clazz : REGISTERABLE_CLASSES) {
try { try {
Constructor ctor = clazz.getConstructor(Context.class, String.class, RealmHelper.class, Constructor ctor = clazz.getConstructor(Context.class, String.class, RealmHelper.class,
DDPClientWraper.class); DDPClientWrapper.class);
Object obj = ctor.newInstance(appContext, hostname, serverConfigRealm, ddpClient); Object obj = ctor.newInstance(appContext, hostname, serverConfigRealm, ddpClient);
if (obj instanceof Registerable) { if (obj instanceof Registrable) {
Registerable registerable = (Registerable) obj; Registrable registerable = (Registrable) obj;
registerable.register(); registerable.register();
listeners.add(registerable); listeners.add(registerable);
} }
...@@ -253,9 +253,9 @@ public class RocketChatWebSocketThread extends HandlerThread { ...@@ -253,9 +253,9 @@ public class RocketChatWebSocketThread extends HandlerThread {
return; return;
} }
Iterator<Registerable> iterator = listeners.iterator(); Iterator<Registrable> iterator = listeners.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
Registerable registerable = iterator.next(); Registrable registerable = iterator.next();
registerable.unregister(); registerable.unregister();
iterator.remove(); iterator.remove();
} }
......
...@@ -9,25 +9,25 @@ import org.json.JSONException; ...@@ -9,25 +9,25 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.util.Iterator; import java.util.Iterator;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogcatIfError;
import chat.rocket.android.log.RCLog; import chat.rocket.android.log.RCLog;
import chat.rocket.android.realm_helper.RealmHelper; import chat.rocket.android.realm_helper.RealmHelper;
import chat.rocket.android.service.Registerable; import chat.rocket.android.service.Registrable;
import chat.rocket.android_ddp.DDPSubscription; import chat.rocket.android_ddp.DDPSubscription;
import rx.Subscription; import rx.Subscription;
public abstract class AbstractDDPDocEventSubscriber implements Registerable { public abstract class AbstractDDPDocEventSubscriber implements Registrable {
protected final Context context; protected final Context context;
protected final String hostname; protected final String hostname;
protected final RealmHelper realmHelper; protected final RealmHelper realmHelper;
protected final DDPClientWraper ddpClient; protected final DDPClientWrapper ddpClient;
private boolean isUnsubscribed; private boolean isUnsubscribed;
private String subscriptionId; private String subscriptionId;
private Subscription rxSubscription; private Subscription rxSubscription;
protected AbstractDDPDocEventSubscriber(Context context, String hostname, protected AbstractDDPDocEventSubscriber(Context context, String hostname,
RealmHelper realmHelper, DDPClientWraper ddpClient) { RealmHelper realmHelper, DDPClientWrapper ddpClient) {
this.context = context; this.context = context;
this.hostname = hostname; this.hostname = hostname;
this.realmHelper = realmHelper; this.realmHelper = realmHelper;
......
...@@ -3,13 +3,13 @@ package chat.rocket.android.service.ddp.base; ...@@ -3,13 +3,13 @@ package chat.rocket.android.service.ddp.base;
import android.content.Context; import android.content.Context;
import org.json.JSONArray; import org.json.JSONArray;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.realm_helper.RealmHelper; import chat.rocket.android.realm_helper.RealmHelper;
import chat.rocket.android.service.ddp.AbstractDDPDocEventSubscriber; import chat.rocket.android.service.ddp.AbstractDDPDocEventSubscriber;
abstract class AbstractBaseSubscriber extends AbstractDDPDocEventSubscriber { abstract class AbstractBaseSubscriber extends AbstractDDPDocEventSubscriber {
protected AbstractBaseSubscriber(Context context, String hostname, RealmHelper realmHelper, protected AbstractBaseSubscriber(Context context, String hostname, RealmHelper realmHelper,
DDPClientWraper ddpClient) { DDPClientWrapper ddpClient) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
} }
......
...@@ -3,7 +3,7 @@ package chat.rocket.android.service.ddp.base; ...@@ -3,7 +3,7 @@ package chat.rocket.android.service.ddp.base;
import android.content.Context; import android.content.Context;
import io.realm.RealmObject; import io.realm.RealmObject;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.model.ddp.User; import chat.rocket.android.model.ddp.User;
import chat.rocket.android.realm_helper.RealmHelper; import chat.rocket.android.realm_helper.RealmHelper;
...@@ -12,7 +12,7 @@ import chat.rocket.android.realm_helper.RealmHelper; ...@@ -12,7 +12,7 @@ import chat.rocket.android.realm_helper.RealmHelper;
*/ */
public class ActiveUsersSubscriber extends AbstractBaseSubscriber { public class ActiveUsersSubscriber extends AbstractBaseSubscriber {
public ActiveUsersSubscriber(Context context, String hostname, RealmHelper realmHelper, public ActiveUsersSubscriber(Context context, String hostname, RealmHelper realmHelper,
DDPClientWraper ddpClient) { DDPClientWrapper ddpClient) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
} }
......
...@@ -3,7 +3,7 @@ package chat.rocket.android.service.ddp.base; ...@@ -3,7 +3,7 @@ package chat.rocket.android.service.ddp.base;
import android.content.Context; import android.content.Context;
import io.realm.RealmObject; import io.realm.RealmObject;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.model.ddp.MeteorLoginServiceConfiguration; import chat.rocket.android.model.ddp.MeteorLoginServiceConfiguration;
import chat.rocket.android.realm_helper.RealmHelper; import chat.rocket.android.realm_helper.RealmHelper;
...@@ -12,7 +12,7 @@ import chat.rocket.android.realm_helper.RealmHelper; ...@@ -12,7 +12,7 @@ import chat.rocket.android.realm_helper.RealmHelper;
*/ */
public class LoginServiceConfigurationSubscriber extends AbstractBaseSubscriber { public class LoginServiceConfigurationSubscriber extends AbstractBaseSubscriber {
public LoginServiceConfigurationSubscriber(Context context, String hostname, public LoginServiceConfigurationSubscriber(Context context, String hostname,
RealmHelper realmHelper, DDPClientWraper ddpClient) { RealmHelper realmHelper, DDPClientWrapper ddpClient) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
} }
......
...@@ -3,7 +3,7 @@ package chat.rocket.android.service.ddp.base; ...@@ -3,7 +3,7 @@ package chat.rocket.android.service.ddp.base;
import android.content.Context; import android.content.Context;
import io.realm.RealmObject; import io.realm.RealmObject;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.model.ddp.User; import chat.rocket.android.model.ddp.User;
import chat.rocket.android.realm_helper.RealmHelper; import chat.rocket.android.realm_helper.RealmHelper;
...@@ -12,7 +12,7 @@ import chat.rocket.android.realm_helper.RealmHelper; ...@@ -12,7 +12,7 @@ import chat.rocket.android.realm_helper.RealmHelper;
*/ */
public class UserDataSubscriber extends AbstractBaseSubscriber { public class UserDataSubscriber extends AbstractBaseSubscriber {
public UserDataSubscriber(Context context, String hostname, RealmHelper realmHelper, public UserDataSubscriber(Context context, String hostname, RealmHelper realmHelper,
DDPClientWraper ddpClient) { DDPClientWrapper ddpClient) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
} }
......
...@@ -5,7 +5,7 @@ import org.json.JSONArray; ...@@ -5,7 +5,7 @@ import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogcatIfError;
import chat.rocket.android.log.RCLog; import chat.rocket.android.log.RCLog;
import chat.rocket.android.realm_helper.RealmHelper; import chat.rocket.android.realm_helper.RealmHelper;
...@@ -15,7 +15,7 @@ import chat.rocket.android_ddp.DDPSubscription; ...@@ -15,7 +15,7 @@ import chat.rocket.android_ddp.DDPSubscription;
abstract class AbstractStreamNotifyEventSubscriber extends AbstractDDPDocEventSubscriber { abstract class AbstractStreamNotifyEventSubscriber extends AbstractDDPDocEventSubscriber {
protected AbstractStreamNotifyEventSubscriber(Context context, String hostname, protected AbstractStreamNotifyEventSubscriber(Context context, String hostname,
RealmHelper realmHelper, RealmHelper realmHelper,
DDPClientWraper ddpClient) { DDPClientWrapper ddpClient) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
} }
......
...@@ -2,7 +2,7 @@ package chat.rocket.android.service.ddp.stream; ...@@ -2,7 +2,7 @@ package chat.rocket.android.service.ddp.stream;
import android.content.Context; import android.content.Context;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.realm_helper.RealmHelper; import chat.rocket.android.realm_helper.RealmHelper;
abstract class AbstractStreamNotifyUserEventSubscriber extends AbstractStreamNotifyEventSubscriber { abstract class AbstractStreamNotifyUserEventSubscriber extends AbstractStreamNotifyEventSubscriber {
...@@ -10,7 +10,7 @@ abstract class AbstractStreamNotifyUserEventSubscriber extends AbstractStreamNot ...@@ -10,7 +10,7 @@ abstract class AbstractStreamNotifyUserEventSubscriber extends AbstractStreamNot
protected AbstractStreamNotifyUserEventSubscriber(Context context, String hostname, protected AbstractStreamNotifyUserEventSubscriber(Context context, String hostname,
RealmHelper realmHelper, RealmHelper realmHelper,
DDPClientWraper ddpClient, String userId) { DDPClientWrapper ddpClient, String userId) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
this.userId = userId; this.userId = userId;
} }
......
...@@ -5,13 +5,13 @@ import io.realm.RealmObject; ...@@ -5,13 +5,13 @@ import io.realm.RealmObject;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.model.ddp.RoomSubscription; import chat.rocket.android.model.ddp.RoomSubscription;
import chat.rocket.android.realm_helper.RealmHelper; import chat.rocket.android.realm_helper.RealmHelper;
public class StreamNotifyUserSubscriptionsChanged extends AbstractStreamNotifyUserEventSubscriber { public class StreamNotifyUserSubscriptionsChanged extends AbstractStreamNotifyUserEventSubscriber {
public StreamNotifyUserSubscriptionsChanged(Context context, String hostname, public StreamNotifyUserSubscriptionsChanged(Context context, String hostname,
RealmHelper realmHelper, DDPClientWraper ddpClient, RealmHelper realmHelper, DDPClientWrapper ddpClient,
String userId) { String userId) {
super(context, hostname, realmHelper, ddpClient, userId); super(context, hostname, realmHelper, ddpClient, userId);
} }
......
...@@ -5,7 +5,7 @@ import io.realm.RealmObject; ...@@ -5,7 +5,7 @@ import io.realm.RealmObject;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.model.ddp.Message; import chat.rocket.android.model.ddp.Message;
import chat.rocket.android.realm_helper.RealmHelper; import chat.rocket.android.realm_helper.RealmHelper;
...@@ -16,7 +16,7 @@ public class StreamRoomMessage extends AbstractStreamNotifyEventSubscriber { ...@@ -16,7 +16,7 @@ public class StreamRoomMessage extends AbstractStreamNotifyEventSubscriber {
private String roomId; private String roomId;
public StreamRoomMessage(Context context, String hostname, public StreamRoomMessage(Context context, String hostname,
RealmHelper realmHelper, DDPClientWraper ddpClient, String roomId) { RealmHelper realmHelper, DDPClientWrapper ddpClient, String roomId) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
this.roomId = roomId; this.roomId = roomId;
} }
......
...@@ -7,9 +7,9 @@ import chat.rocket.android.RocketChatCache; ...@@ -7,9 +7,9 @@ import chat.rocket.android.RocketChatCache;
import chat.rocket.android.helper.TextUtils; import chat.rocket.android.helper.TextUtils;
import chat.rocket.android.model.ddp.RoomSubscription; import chat.rocket.android.model.ddp.RoomSubscription;
import chat.rocket.android.realm_helper.RealmHelper; import chat.rocket.android.realm_helper.RealmHelper;
import chat.rocket.android.service.Registerable; import chat.rocket.android.service.Registrable;
public abstract class AbstractRocketChatCacheObserver implements Registerable { public abstract class AbstractRocketChatCacheObserver implements Registrable {
private final Context context; private final Context context;
private final RealmHelper realmHelper; private final RealmHelper realmHelper;
private String roomId; private String roomId;
......
...@@ -4,25 +4,25 @@ import android.content.Context; ...@@ -4,25 +4,25 @@ import android.content.Context;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.realm_helper.RealmHelper; import chat.rocket.android.realm_helper.RealmHelper;
import chat.rocket.android.service.Registerable; import chat.rocket.android.service.Registrable;
import chat.rocket.android.service.ddp.stream.StreamRoomMessage; import chat.rocket.android.service.ddp.stream.StreamRoomMessage;
/** /**
* wrapper for managing stream-notify-message depending on RocketChatCache. * wrapper for managing stream-notify-message depending on RocketChatCache.
*/ */
public class StreamRoomMessageManager implements Registerable { public class StreamRoomMessageManager implements Registrable {
private final Context context; private final Context context;
private final String hostname; private final String hostname;
private final RealmHelper realmHelper; private final RealmHelper realmHelper;
private final DDPClientWraper ddpClient; private final DDPClientWrapper ddpClient;
private final AbstractRocketChatCacheObserver cacheObserver; private final AbstractRocketChatCacheObserver cacheObserver;
private final Handler handler; private final Handler handler;
private StreamRoomMessage streamRoomMessage; private StreamRoomMessage streamRoomMessage;
public StreamRoomMessageManager(Context context, String hostname, public StreamRoomMessageManager(Context context, String hostname,
RealmHelper realmHelper, DDPClientWraper ddpClient) { RealmHelper realmHelper, DDPClientWrapper ddpClient) {
this.context = context; this.context = context;
this.hostname = hostname; this.hostname = hostname;
this.realmHelper = realmHelper; this.realmHelper = realmHelper;
......
...@@ -3,22 +3,22 @@ package chat.rocket.android.service.observer; ...@@ -3,22 +3,22 @@ package chat.rocket.android.service.observer;
import android.content.Context; import android.content.Context;
import io.realm.RealmObject; import io.realm.RealmObject;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.realm_helper.RealmHelper; import chat.rocket.android.realm_helper.RealmHelper;
import chat.rocket.android.realm_helper.RealmListObserver; import chat.rocket.android.realm_helper.RealmListObserver;
import chat.rocket.android.service.Registerable; import chat.rocket.android.service.Registrable;
abstract class AbstractModelObserver<T extends RealmObject> abstract class AbstractModelObserver<T extends RealmObject>
implements Registerable, RealmListObserver.Query<T>, RealmListObserver.OnUpdateListener<T> { implements Registrable, RealmListObserver.Query<T>, RealmListObserver.OnUpdateListener<T> {
protected final Context context; protected final Context context;
protected final String hostname; protected final String hostname;
protected final RealmHelper realmHelper; protected final RealmHelper realmHelper;
protected final DDPClientWraper ddpClient; protected final DDPClientWrapper ddpClient;
private final RealmListObserver observer; private final RealmListObserver observer;
protected AbstractModelObserver(Context context, String hostname, protected AbstractModelObserver(Context context, String hostname,
RealmHelper realmHelper, DDPClientWraper ddpClient) { RealmHelper realmHelper, DDPClientWrapper ddpClient) {
this.context = context; this.context = context;
this.hostname = hostname; this.hostname = hostname;
this.realmHelper = realmHelper; this.realmHelper = realmHelper;
......
...@@ -6,12 +6,12 @@ import io.realm.RealmResults; ...@@ -6,12 +6,12 @@ import io.realm.RealmResults;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.api.MethodCallHelper; import chat.rocket.android.api.MethodCallHelper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogcatIfError;
import chat.rocket.android.model.ddp.User; import chat.rocket.android.model.ddp.User;
import chat.rocket.android.realm_helper.RealmHelper; import chat.rocket.android.realm_helper.RealmHelper;
import chat.rocket.android.service.Registerable; import chat.rocket.android.service.Registrable;
import chat.rocket.android.service.ddp.stream.StreamNotifyUserSubscriptionsChanged; import chat.rocket.android.service.ddp.stream.StreamNotifyUserSubscriptionsChanged;
import hugo.weaving.DebugLog; import hugo.weaving.DebugLog;
...@@ -21,10 +21,10 @@ import hugo.weaving.DebugLog; ...@@ -21,10 +21,10 @@ import hugo.weaving.DebugLog;
public class CurrentUserObserver extends AbstractModelObserver<User> { public class CurrentUserObserver extends AbstractModelObserver<User> {
private final MethodCallHelper methodCall; private final MethodCallHelper methodCall;
private boolean currentUserExists; private boolean currentUserExists;
private ArrayList<Registerable> listeners; private ArrayList<Registrable> listeners;
public CurrentUserObserver(Context context, String hostname, public CurrentUserObserver(Context context, String hostname,
RealmHelper realmHelper, DDPClientWraper ddpClient) { RealmHelper realmHelper, DDPClientWrapper ddpClient) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
methodCall = new MethodCallHelper(realmHelper, ddpClient); methodCall = new MethodCallHelper(realmHelper, ddpClient);
currentUserExists = false; currentUserExists = false;
...@@ -61,7 +61,7 @@ public class CurrentUserObserver extends AbstractModelObserver<User> { ...@@ -61,7 +61,7 @@ public class CurrentUserObserver extends AbstractModelObserver<User> {
// get and observe Room subscriptions. // get and observe Room subscriptions.
methodCall.getRoomSubscriptions().onSuccess(task -> { methodCall.getRoomSubscriptions().onSuccess(task -> {
if (listeners != null) { if (listeners != null) {
Registerable listener = new StreamNotifyUserSubscriptionsChanged( Registrable listener = new StreamNotifyUserSubscriptionsChanged(
context, hostname, realmHelper, ddpClient, userId); context, hostname, realmHelper, ddpClient, userId);
listener.register(); listener.register();
listeners.add(listener); listeners.add(listener);
...@@ -73,7 +73,7 @@ public class CurrentUserObserver extends AbstractModelObserver<User> { ...@@ -73,7 +73,7 @@ public class CurrentUserObserver extends AbstractModelObserver<User> {
@DebugLog @DebugLog
private void onLogout() { private void onLogout() {
if (listeners != null) { if (listeners != null) {
for (Registerable listener : listeners) { for (Registrable listener : listeners) {
listener.unregister(); listener.unregister();
} }
} }
......
...@@ -11,7 +11,7 @@ import java.io.IOException; ...@@ -11,7 +11,7 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.List; import java.util.List;
import bolts.Task; import bolts.Task;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.api.FileUploadingHelper; import chat.rocket.android.api.FileUploadingHelper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogcatIfError;
import chat.rocket.android.helper.OkHttpHelper; import chat.rocket.android.helper.OkHttpHelper;
...@@ -35,7 +35,7 @@ public class FileUploadingToS3Observer extends AbstractModelObserver<FileUploadi ...@@ -35,7 +35,7 @@ public class FileUploadingToS3Observer extends AbstractModelObserver<FileUploadi
private FileUploadingHelper methodCall; private FileUploadingHelper methodCall;
public FileUploadingToS3Observer(Context context, String hostname, public FileUploadingToS3Observer(Context context, String hostname,
RealmHelper realmHelper, DDPClientWraper ddpClient) { RealmHelper realmHelper, DDPClientWrapper ddpClient) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
methodCall = new FileUploadingHelper(realmHelper, ddpClient); methodCall = new FileUploadingHelper(realmHelper, ddpClient);
......
...@@ -9,7 +9,7 @@ import org.json.JSONObject; ...@@ -9,7 +9,7 @@ import org.json.JSONObject;
import java.io.InputStream; import java.io.InputStream;
import java.util.List; import java.util.List;
import bolts.Task; import bolts.Task;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.api.FileUploadingHelper; import chat.rocket.android.api.FileUploadingHelper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogcatIfError;
import chat.rocket.android.helper.OkHttpHelper; import chat.rocket.android.helper.OkHttpHelper;
...@@ -31,7 +31,7 @@ public class FileUploadingWithUfsObserver extends AbstractModelObserver<FileUplo ...@@ -31,7 +31,7 @@ public class FileUploadingWithUfsObserver extends AbstractModelObserver<FileUplo
private FileUploadingHelper methodCall; private FileUploadingHelper methodCall;
public FileUploadingWithUfsObserver(Context context, String hostname, public FileUploadingWithUfsObserver(Context context, String hostname,
RealmHelper realmHelper, DDPClientWraper ddpClient) { RealmHelper realmHelper, DDPClientWrapper ddpClient) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
methodCall = new FileUploadingHelper(realmHelper, ddpClient); methodCall = new FileUploadingHelper(realmHelper, ddpClient);
......
...@@ -7,7 +7,7 @@ import org.json.JSONObject; ...@@ -7,7 +7,7 @@ import org.json.JSONObject;
import java.util.List; import java.util.List;
import bolts.Task; import bolts.Task;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.api.MethodCallHelper; import chat.rocket.android.api.MethodCallHelper;
import chat.rocket.android.log.RCLog; import chat.rocket.android.log.RCLog;
import chat.rocket.android.model.SyncState; import chat.rocket.android.model.SyncState;
...@@ -23,7 +23,7 @@ public class GetUsersOfRoomsProcedureObserver ...@@ -23,7 +23,7 @@ public class GetUsersOfRoomsProcedureObserver
private final MethodCallHelper methodCall; private final MethodCallHelper methodCall;
public GetUsersOfRoomsProcedureObserver(Context context, String hostname, public GetUsersOfRoomsProcedureObserver(Context context, String hostname,
RealmHelper realmHelper, DDPClientWraper ddpClient) { RealmHelper realmHelper, DDPClientWrapper ddpClient) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
methodCall = new MethodCallHelper(realmHelper, ddpClient); methodCall = new MethodCallHelper(realmHelper, ddpClient);
} }
......
...@@ -8,7 +8,7 @@ import org.json.JSONObject; ...@@ -8,7 +8,7 @@ import org.json.JSONObject;
import java.util.List; import java.util.List;
import bolts.Task; import bolts.Task;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.api.MethodCallHelper; import chat.rocket.android.api.MethodCallHelper;
import chat.rocket.android.log.RCLog; import chat.rocket.android.log.RCLog;
import chat.rocket.android.model.SyncState; import chat.rocket.android.model.SyncState;
...@@ -24,7 +24,7 @@ public class LoadMessageProcedureObserver extends AbstractModelObserver<LoadMess ...@@ -24,7 +24,7 @@ public class LoadMessageProcedureObserver extends AbstractModelObserver<LoadMess
private final MethodCallHelper methodCall; private final MethodCallHelper methodCall;
public LoadMessageProcedureObserver(Context context, String hostname, public LoadMessageProcedureObserver(Context context, String hostname,
RealmHelper realmHelper, DDPClientWraper ddpClient) { RealmHelper realmHelper, DDPClientWrapper ddpClient) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
methodCall = new MethodCallHelper(realmHelper, ddpClient); methodCall = new MethodCallHelper(realmHelper, ddpClient);
} }
......
...@@ -6,7 +6,7 @@ import io.realm.RealmResults; ...@@ -6,7 +6,7 @@ import io.realm.RealmResults;
import org.json.JSONObject; import org.json.JSONObject;
import java.util.List; import java.util.List;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.helper.CheckSum; import chat.rocket.android.helper.CheckSum;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogcatIfError;
import chat.rocket.android.model.SyncState; import chat.rocket.android.model.SyncState;
...@@ -25,7 +25,7 @@ public class MethodCallObserver extends AbstractModelObserver<MethodCall> { ...@@ -25,7 +25,7 @@ public class MethodCallObserver extends AbstractModelObserver<MethodCall> {
* constructor. * constructor.
*/ */
public MethodCallObserver(Context context, String hostname, public MethodCallObserver(Context context, String hostname,
RealmHelper realmHelper, DDPClientWraper ddpClient) { RealmHelper realmHelper, DDPClientWrapper ddpClient) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
realmHelper.executeTransaction(realm -> { realmHelper.executeTransaction(realm -> {
// resume pending operations. // resume pending operations.
......
...@@ -6,7 +6,7 @@ import io.realm.RealmResults; ...@@ -6,7 +6,7 @@ import io.realm.RealmResults;
import org.json.JSONObject; import org.json.JSONObject;
import java.util.List; import java.util.List;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.api.MethodCallHelper; import chat.rocket.android.api.MethodCallHelper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogcatIfError;
import chat.rocket.android.log.RCLog; import chat.rocket.android.log.RCLog;
...@@ -22,7 +22,7 @@ public class NewMessageObserver extends AbstractModelObserver<Message> { ...@@ -22,7 +22,7 @@ public class NewMessageObserver extends AbstractModelObserver<Message> {
private final MethodCallHelper methodCall; private final MethodCallHelper methodCall;
public NewMessageObserver(Context context, String hostname, public NewMessageObserver(Context context, String hostname,
RealmHelper realmHelper, DDPClientWraper ddpClient) { RealmHelper realmHelper, DDPClientWrapper ddpClient) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
methodCall = new MethodCallHelper(realmHelper, ddpClient); methodCall = new MethodCallHelper(realmHelper, ddpClient);
......
...@@ -17,7 +17,7 @@ import java.util.List; ...@@ -17,7 +17,7 @@ import java.util.List;
import bolts.Task; import bolts.Task;
import chat.rocket.android.R; import chat.rocket.android.R;
import chat.rocket.android.activity.MainActivity; import chat.rocket.android.activity.MainActivity;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.helper.Avatar; import chat.rocket.android.helper.Avatar;
import chat.rocket.android.helper.TextUtils; import chat.rocket.android.helper.TextUtils;
import chat.rocket.android.model.ServerConfig; import chat.rocket.android.model.ServerConfig;
...@@ -31,7 +31,7 @@ import chat.rocket.android.service.notification.NotificationDismissalCallbackSer ...@@ -31,7 +31,7 @@ import chat.rocket.android.service.notification.NotificationDismissalCallbackSer
*/ */
public class NotificationItemObserver extends AbstractModelObserver<NotificationItem> { public class NotificationItemObserver extends AbstractModelObserver<NotificationItem> {
public NotificationItemObserver(Context context, String hostname, RealmHelper realmHelper, public NotificationItemObserver(Context context, String hostname, RealmHelper realmHelper,
DDPClientWraper ddpClient) { DDPClientWrapper ddpClient) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
} }
......
...@@ -8,7 +8,7 @@ import org.json.JSONException; ...@@ -8,7 +8,7 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.util.List; import java.util.List;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogcatIfError;
import chat.rocket.android.log.RCLog; import chat.rocket.android.log.RCLog;
import chat.rocket.android.model.ddp.RoomSubscription; import chat.rocket.android.model.ddp.RoomSubscription;
...@@ -20,7 +20,7 @@ import chat.rocket.android.realm_helper.RealmHelper; ...@@ -20,7 +20,7 @@ import chat.rocket.android.realm_helper.RealmHelper;
*/ */
public class ReactiveNotificationManager extends AbstractModelObserver<RoomSubscription> { public class ReactiveNotificationManager extends AbstractModelObserver<RoomSubscription> {
public ReactiveNotificationManager(Context context, String hostname, public ReactiveNotificationManager(Context context, String hostname,
RealmHelper realmHelper, DDPClientWraper ddpClient) { RealmHelper realmHelper, DDPClientWrapper ddpClient) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
} }
......
...@@ -5,7 +5,7 @@ import io.realm.Realm; ...@@ -5,7 +5,7 @@ import io.realm.Realm;
import io.realm.RealmResults; import io.realm.RealmResults;
import java.util.List; import java.util.List;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.api.MethodCallHelper; import chat.rocket.android.api.MethodCallHelper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogcatIfError;
import chat.rocket.android.model.ddp.PublicSetting; import chat.rocket.android.model.ddp.PublicSetting;
...@@ -28,7 +28,7 @@ public class SessionObserver extends AbstractModelObserver<Session> { ...@@ -28,7 +28,7 @@ public class SessionObserver extends AbstractModelObserver<Session> {
* constructor. * constructor.
*/ */
public SessionObserver(Context context, String hostname, public SessionObserver(Context context, String hostname,
RealmHelper realmHelper, DDPClientWraper ddpClient) { RealmHelper realmHelper, DDPClientWrapper ddpClient) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
count = 0; count = 0;
......
...@@ -5,7 +5,7 @@ import io.realm.Realm; ...@@ -5,7 +5,7 @@ import io.realm.Realm;
import io.realm.RealmResults; import io.realm.RealmResults;
import java.util.List; import java.util.List;
import chat.rocket.android.api.DDPClientWraper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.api.MethodCallHelper; import chat.rocket.android.api.MethodCallHelper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogcatIfError;
import chat.rocket.android.model.internal.Session; import chat.rocket.android.model.internal.Session;
...@@ -16,7 +16,7 @@ public class TokenLoginObserver extends AbstractModelObserver<Session> { ...@@ -16,7 +16,7 @@ public class TokenLoginObserver extends AbstractModelObserver<Session> {
private final MethodCallHelper methodCall; private final MethodCallHelper methodCall;
public TokenLoginObserver(Context context, String hostname, public TokenLoginObserver(Context context, String hostname,
RealmHelper realmHelper, DDPClientWraper ddpClient) { RealmHelper realmHelper, DDPClientWrapper ddpClient) {
super(context, hostname, realmHelper, ddpClient); super(context, hostname, realmHelper, ddpClient);
methodCall = new MethodCallHelper(realmHelper, ddpClient); methodCall = new MethodCallHelper(realmHelper, ddpClient);
} }
......
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