Commit 15963ce3 authored by Tiago Cunha's avatar Tiago Cunha

Small clean up

parent 4ab44fd0
...@@ -18,9 +18,7 @@ import chat.rocket.android.helper.LogcatIfError; ...@@ -18,9 +18,7 @@ import chat.rocket.android.helper.LogcatIfError;
import chat.rocket.core.interactors.CanCreateRoomInteractor; import chat.rocket.core.interactors.CanCreateRoomInteractor;
import chat.rocket.core.interactors.RoomInteractor; import chat.rocket.core.interactors.RoomInteractor;
import chat.rocket.core.interactors.SessionInteractor; import chat.rocket.core.interactors.SessionInteractor;
import chat.rocket.persistence.realm.models.ddp.RealmUser; import chat.rocket.core.models.User;
import chat.rocket.persistence.realm.models.internal.RealmSession;
import chat.rocket.persistence.realm.RealmObjectObserver;
import chat.rocket.android.service.ConnectivityManager; import chat.rocket.android.service.ConnectivityManager;
import chat.rocket.android.widget.RoomToolbar; import chat.rocket.android.widget.RoomToolbar;
import chat.rocket.persistence.realm.repositories.RealmRoomRepository; import chat.rocket.persistence.realm.repositories.RealmRoomRepository;
...@@ -33,7 +31,6 @@ import hugo.weaving.DebugLog; ...@@ -33,7 +31,6 @@ import hugo.weaving.DebugLog;
*/ */
public class MainActivity extends AbstractAuthedActivity implements MainContract.View { public class MainActivity extends AbstractAuthedActivity implements MainContract.View {
private RealmObjectObserver<RealmSession> sessionObserver;
private StatusTicker statusTicker; private StatusTicker statusTicker;
private MainContract.Presenter presenter; private MainContract.Presenter presenter;
...@@ -93,14 +90,14 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract ...@@ -93,14 +90,14 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
private void setUserOnlineIfServerAvailable() { private void setUserOnlineIfServerAvailable() {
if (hostname != null) { if (hostname != null) {
new MethodCallHelper(this, hostname).setUserPresence(RealmUser.STATUS_ONLINE) new MethodCallHelper(this, hostname).setUserPresence(User.STATUS_ONLINE)
.continueWith(new LogcatIfError()); .continueWith(new LogcatIfError());
} }
} }
private void setUserAwayIfServerAvailable() { private void setUserAwayIfServerAvailable() {
if (hostname != null) { if (hostname != null) {
new MethodCallHelper(this, hostname).setUserPresence(RealmUser.STATUS_AWAY) new MethodCallHelper(this, hostname).setUserPresence(User.STATUS_AWAY)
.continueWith(new LogcatIfError()); .continueWith(new LogcatIfError());
} }
} }
...@@ -205,15 +202,6 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract ...@@ -205,15 +202,6 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
presenter.onOpenRoom(hostname, roomId); presenter.onOpenRoom(hostname, roomId);
} }
@Override
protected void onDestroy() {
if (sessionObserver != null) {
sessionObserver.unsub();
sessionObserver = null;
}
super.onDestroy();
}
@Override @Override
protected boolean onBackPress() { protected boolean onBackPress() {
return closeSidebarIfNeeded() || super.onBackPress(); return closeSidebarIfNeeded() || super.onBackPress();
......
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