use of chat.rocket.core.models.Settings in project Rocket.Chat.Android by RocketChat.
the class RoomPresenter method getUserPreferences.
private void getUserPreferences() {
final Disposable subscription = userRepository.getCurrent().filter(Optional::isPresent).map(Optional::get).filter(user -> user.getSettings() != null).map(User::getSettings).filter(settings -> settings.getPreferences() != null).map(Settings::getPreferences).distinctUntilChanged().subscribeOn(AndroidSchedulers.from(BackgroundLooper.get())).observeOn(AndroidSchedulers.mainThread()).subscribe(preferences -> {
if (preferences.isAutoImageLoad()) {
view.autoloadImages();
} else {
view.manualLoadImages();
}
}, Logger::report);
addSubscription(subscription);
}
Aggregations