Search in sources :

Example 1 with RealmRoomRepository

use of chat.rocket.persistence.realm.repositories.RealmRoomRepository in project Rocket.Chat.Android by RocketChat.

the class SidebarMainFragment method onCreate.

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle args = getArguments();
    hostname = args == null ? null : args.getString(HOSTNAME);
    methodCallHelper = new MethodCallHelper(getContext(), hostname);
    realmSpotlightRoomRepository = new RealmSpotlightRoomRepository(hostname);
    RealmUserRepository userRepository = new RealmUserRepository(hostname);
    AbsoluteUrlHelper absoluteUrlHelper = new AbsoluteUrlHelper(hostname, new RealmServerInfoRepository(), userRepository, new SessionInteractor(new RealmSessionRepository(hostname)));
    presenter = new SidebarMainPresenter(hostname, new RoomInteractor(new RealmRoomRepository(hostname)), userRepository, new RocketChatCache(getContext()), absoluteUrlHelper, TextUtils.isEmpty(hostname) ? null : new MethodCallHelper(getContext(), hostname));
}
Also used : SessionInteractor(chat.rocket.core.interactors.SessionInteractor) MethodCallHelper(chat.rocket.android.api.MethodCallHelper) RealmSpotlightRoomRepository(chat.rocket.persistence.realm.repositories.RealmSpotlightRoomRepository) AbsoluteUrlHelper(chat.rocket.android.helper.AbsoluteUrlHelper) RealmSessionRepository(chat.rocket.persistence.realm.repositories.RealmSessionRepository) RoomInteractor(chat.rocket.core.interactors.RoomInteractor) Bundle(android.os.Bundle) RocketChatCache(chat.rocket.android.RocketChatCache) RealmRoomRepository(chat.rocket.persistence.realm.repositories.RealmRoomRepository) RealmServerInfoRepository(chat.rocket.persistence.realm.repositories.RealmServerInfoRepository) RealmUserRepository(chat.rocket.persistence.realm.repositories.RealmUserRepository)

Example 2 with RealmRoomRepository

use of chat.rocket.persistence.realm.repositories.RealmRoomRepository in project Rocket.Chat.Android by RocketChat.

the class RoomFragment method onCreate.

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle args = getArguments();
    hostname = args.getString(HOSTNAME);
    roomId = args.getString(ROOM_ID);
    roomRepository = new RealmRoomRepository(hostname);
    MessageInteractor messageInteractor = new MessageInteractor(new RealmMessageRepository(hostname), roomRepository);
    userRepository = new RealmUserRepository(hostname);
    absoluteUrlHelper = new AbsoluteUrlHelper(hostname, new RealmServerInfoRepository(), userRepository, new SessionInteractor(new RealmSessionRepository(hostname)));
    methodCallHelper = new MethodCallHelper(getContext(), hostname);
    presenter = new RoomPresenter(roomId, userRepository, messageInteractor, roomRepository, absoluteUrlHelper, methodCallHelper, ConnectivityManager.getInstance(getContext()));
    if (savedInstanceState == null) {
        presenter.loadMessages();
    }
}
Also used : SessionInteractor(chat.rocket.core.interactors.SessionInteractor) MethodCallHelper(chat.rocket.android.api.MethodCallHelper) AbsoluteUrlHelper(chat.rocket.android.helper.AbsoluteUrlHelper) RealmSessionRepository(chat.rocket.persistence.realm.repositories.RealmSessionRepository) MessageInteractor(chat.rocket.core.interactors.MessageInteractor) Bundle(android.os.Bundle) RealmRoomRepository(chat.rocket.persistence.realm.repositories.RealmRoomRepository) RealmMessageRepository(chat.rocket.persistence.realm.repositories.RealmMessageRepository) RealmServerInfoRepository(chat.rocket.persistence.realm.repositories.RealmServerInfoRepository) RealmUserRepository(chat.rocket.persistence.realm.repositories.RealmUserRepository)

Example 3 with RealmRoomRepository

use of chat.rocket.persistence.realm.repositories.RealmRoomRepository 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)

Example 4 with RealmRoomRepository

use of chat.rocket.persistence.realm.repositories.RealmRoomRepository in project Rocket.Chat.Android by RocketChat.

the class MessageOptionsDialogFragment method getEditMessageInteractor.

private EditMessageInteractor getEditMessageInteractor(String hostname) {
    UserRepository userRepository = new RealmUserRepository(hostname);
    RoomRoleRepository roomRoleRepository = new RealmRoomRoleRepository(hostname);
    PermissionRepository permissionRepository = new RealmPermissionRepository(hostname);
    PermissionInteractor permissionInteractor = new PermissionInteractor(userRepository, roomRoleRepository, permissionRepository);
    MessageRepository messageRepository = new RealmMessageRepository(hostname);
    RoomRepository roomRepository = new RealmRoomRepository(hostname);
    PublicSettingRepository publicSettingRepository = new RealmPublicSettingRepository(hostname);
    return new EditMessageInteractor(permissionInteractor, userRepository, messageRepository, roomRepository, publicSettingRepository);
}
Also used : RealmPermissionRepository(chat.rocket.persistence.realm.repositories.RealmPermissionRepository) PermissionInteractor(chat.rocket.core.interactors.PermissionInteractor) PermissionRepository(chat.rocket.core.repositories.PermissionRepository) RealmPermissionRepository(chat.rocket.persistence.realm.repositories.RealmPermissionRepository) RealmPublicSettingRepository(chat.rocket.persistence.realm.repositories.RealmPublicSettingRepository) PublicSettingRepository(chat.rocket.core.repositories.PublicSettingRepository) RealmMessageRepository(chat.rocket.persistence.realm.repositories.RealmMessageRepository) RealmPublicSettingRepository(chat.rocket.persistence.realm.repositories.RealmPublicSettingRepository) UserRepository(chat.rocket.core.repositories.UserRepository) RealmUserRepository(chat.rocket.persistence.realm.repositories.RealmUserRepository) RealmRoomRoleRepository(chat.rocket.persistence.realm.repositories.RealmRoomRoleRepository) EditMessageInteractor(chat.rocket.core.interactors.EditMessageInteractor) RealmRoomRoleRepository(chat.rocket.persistence.realm.repositories.RealmRoomRoleRepository) RoomRoleRepository(chat.rocket.core.repositories.RoomRoleRepository) MessageRepository(chat.rocket.core.repositories.MessageRepository) RealmMessageRepository(chat.rocket.persistence.realm.repositories.RealmMessageRepository) RealmRoomRepository(chat.rocket.persistence.realm.repositories.RealmRoomRepository) RoomRepository(chat.rocket.core.repositories.RoomRepository) RealmRoomRepository(chat.rocket.persistence.realm.repositories.RealmRoomRepository) RealmUserRepository(chat.rocket.persistence.realm.repositories.RealmUserRepository)

Aggregations

RealmRoomRepository (chat.rocket.persistence.realm.repositories.RealmRoomRepository)4 RealmUserRepository (chat.rocket.persistence.realm.repositories.RealmUserRepository)4 MethodCallHelper (chat.rocket.android.api.MethodCallHelper)3 SessionInteractor (chat.rocket.core.interactors.SessionInteractor)3 RealmSessionRepository (chat.rocket.persistence.realm.repositories.RealmSessionRepository)3 Bundle (android.os.Bundle)2 RocketChatCache (chat.rocket.android.RocketChatCache)2 AbsoluteUrlHelper (chat.rocket.android.helper.AbsoluteUrlHelper)2 RoomInteractor (chat.rocket.core.interactors.RoomInteractor)2 RealmMessageRepository (chat.rocket.persistence.realm.repositories.RealmMessageRepository)2 RealmServerInfoRepository (chat.rocket.persistence.realm.repositories.RealmServerInfoRepository)2 CanCreateRoomInteractor (chat.rocket.core.interactors.CanCreateRoomInteractor)1 EditMessageInteractor (chat.rocket.core.interactors.EditMessageInteractor)1 MessageInteractor (chat.rocket.core.interactors.MessageInteractor)1 PermissionInteractor (chat.rocket.core.interactors.PermissionInteractor)1 MessageRepository (chat.rocket.core.repositories.MessageRepository)1 PermissionRepository (chat.rocket.core.repositories.PermissionRepository)1 PublicSettingRepository (chat.rocket.core.repositories.PublicSettingRepository)1 RoomRepository (chat.rocket.core.repositories.RoomRepository)1 RoomRoleRepository (chat.rocket.core.repositories.RoomRoleRepository)1