Commit 189c7958 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update RealmSpotlightUserRepository.java

parent 7c37ce2a
...@@ -16,8 +16,7 @@ import chat.rocket.persistence.realm.RealmStore; ...@@ -16,8 +16,7 @@ import chat.rocket.persistence.realm.RealmStore;
import chat.rocket.persistence.realm.models.ddp.RealmSpotlightUser; import chat.rocket.persistence.realm.models.ddp.RealmSpotlightUser;
import hu.akarnokd.rxjava.interop.RxJavaInterop; import hu.akarnokd.rxjava.interop.RxJavaInterop;
public class RealmSpotlightUserRepository extends RealmRepository public class RealmSpotlightUserRepository extends RealmRepository implements SpotlightUserRepository {
implements SpotlightUserRepository {
private final String hostname; private final String hostname;
...@@ -26,8 +25,7 @@ public class RealmSpotlightUserRepository extends RealmRepository ...@@ -26,8 +25,7 @@ public class RealmSpotlightUserRepository extends RealmRepository
} }
@Override @Override
public Flowable<List<SpotlightUser>> getSuggestionsFor(String name, SortDirection direction, public Flowable<List<SpotlightUser>> getSuggestionsFor(String name, SortDirection direction, int limit) {
int limit) {
return Flowable.defer(() -> Flowable.using( return Flowable.defer(() -> Flowable.using(
() -> new Pair<>(RealmStore.getRealm(hostname), Looper.myLooper()), () -> new Pair<>(RealmStore.getRealm(hostname), Looper.myLooper()),
pair -> RxJavaInterop.toV2Flowable( pair -> RxJavaInterop.toV2Flowable(
......
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