Search in sources :

Example 1 with CanCreateRoomInteractor

use of chat.rocket.core.interactors.CanCreateRoomInteractor 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);
}
Also used : SessionInteractor(chat.rocket.core.interactors.SessionInteractor) MethodCallHelper(chat.rocket.android.api.MethodCallHelper) CanCreateRoomInteractor(chat.rocket.core.interactors.CanCreateRoomInteractor) RoomInteractor(chat.rocket.core.interactors.RoomInteractor) RealmSessionRepository(chat.rocket.persistence.realm.repositories.RealmSessionRepository) CanCreateRoomInteractor(chat.rocket.core.interactors.CanCreateRoomInteractor) RocketChatCache(chat.rocket.android.RocketChatCache) RealmRoomRepository(chat.rocket.persistence.realm.repositories.RealmRoomRepository) RealmUserRepository(chat.rocket.persistence.realm.repositories.RealmUserRepository) DebugLog(hugo.weaving.DebugLog)

Aggregations

RocketChatCache (chat.rocket.android.RocketChatCache)1 MethodCallHelper (chat.rocket.android.api.MethodCallHelper)1 CanCreateRoomInteractor (chat.rocket.core.interactors.CanCreateRoomInteractor)1 RoomInteractor (chat.rocket.core.interactors.RoomInteractor)1 SessionInteractor (chat.rocket.core.interactors.SessionInteractor)1 RealmRoomRepository (chat.rocket.persistence.realm.repositories.RealmRoomRepository)1 RealmSessionRepository (chat.rocket.persistence.realm.repositories.RealmSessionRepository)1 RealmUserRepository (chat.rocket.persistence.realm.repositories.RealmUserRepository)1 DebugLog (hugo.weaving.DebugLog)1