use of chat.rocket.core.interactors.SessionInteractor in project Rocket.Chat.Android by RocketChat.
the class LoginActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String hostname = null;
Intent intent = getIntent();
if (intent != null && intent.getExtras() != null) {
hostname = intent.getStringExtra(KEY_HOSTNAME);
}
presenter = new LoginPresenter(hostname, new SessionInteractor(new RealmSessionRepository(hostname)), ConnectivityManager.getInstance(getApplicationContext()));
}
use of chat.rocket.core.interactors.SessionInteractor in project Rocket.Chat.Android by RocketChat.
the class MainActivity method onHostnameUpdated.
@DebugLog
@Override
protected void onHostnameUpdated() {
super.onHostnameUpdated();
if (presenter != null) {
presenter.release();
}
RoomInteractor roomInteractor = new RoomInteractor(new RealmRoomRepository(hostname));
CanCreateRoomInteractor createRoomInteractor = new CanCreateRoomInteractor(new RealmUserRepository(hostname), new SessionInteractor(new RealmSessionRepository(hostname)));
SessionInteractor sessionInteractor = new SessionInteractor(new RealmSessionRepository(hostname));
presenter = new MainPresenter(roomInteractor, createRoomInteractor, sessionInteractor, new MethodCallHelper(this, hostname), ConnectivityManager.getInstance(getApplicationContext()), new RocketChatCache(this));
updateSidebarMainFragment();
presenter.bindView(this);
}
Aggregations