discord-jadx/app/src/main/java/com/discord/utilities/search/network/SearchFetcher$getRestObserv...

36 lines
2.0 KiB
Java

package com.discord.utilities.search.network;
import com.discord.models.domain.ModelSearchResponse;
import com.discord.stores.StoreSearch;
import com.discord.utilities.rest.RestAPI;
import j0.k.b;
import java.util.List;
import java.util.Map;
import kotlin.NoWhenBranchMatchedException;
import rx.Observable;
/* compiled from: SearchFetcher.kt */
public final class SearchFetcher$getRestObservable$3<T, R> implements b<Integer, Observable<? extends ModelSearchResponse>> {
public final /* synthetic */ Long $oldestMessageId;
public final /* synthetic */ Map $queryParams;
public final /* synthetic */ SearchQuery $searchQuery;
public final /* synthetic */ StoreSearch.SearchTarget $searchTarget;
public SearchFetcher$getRestObservable$3(StoreSearch.SearchTarget searchTarget, Long l, Map map, SearchQuery searchQuery) {
this.$searchTarget = searchTarget;
this.$oldestMessageId = l;
this.$queryParams = map;
this.$searchQuery = searchQuery;
}
public final Observable<? extends ModelSearchResponse> call(Integer num) {
int ordinal = this.$searchTarget.getType().ordinal();
if (ordinal == 0) {
return RestAPI.Companion.getApi().searchGuildMessages(this.$searchTarget.getId(), this.$oldestMessageId, (List) this.$queryParams.get("author_id"), (List) this.$queryParams.get("mentions"), (List) this.$queryParams.get("channel_id"), (List) this.$queryParams.get("has"), (List) this.$queryParams.get("content"), num, Boolean.valueOf(this.$searchQuery.getIncludeNsfw()));
}
if (ordinal == 1) {
return RestAPI.Companion.getApi().searchChannelMessages(this.$searchTarget.getId(), this.$oldestMessageId, (List) this.$queryParams.get("author_id"), (List) this.$queryParams.get("mentions"), (List) this.$queryParams.get("has"), (List) this.$queryParams.get("content"), num, Boolean.valueOf(this.$searchQuery.getIncludeNsfw()));
}
throw new NoWhenBranchMatchedException();
}
}