mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-25 18:38:22 +01:00
Filter saved posts
Signed-off-by: Balazs Toldi <balazs@toldi.eu>
This commit is contained in:
parent
1f3d9e58d8
commit
b82e4d9d37
@ -45,14 +45,10 @@ import eu.toldi.infinityforlemmy.post.PostPagingSource;
|
||||
import eu.toldi.infinityforlemmy.readpost.InsertReadPost;
|
||||
import eu.toldi.infinityforlemmy.utils.SharedPreferencesUtils;
|
||||
import eu.toldi.infinityforlemmy.utils.Utils;
|
||||
import retrofit2.Retrofit;
|
||||
|
||||
public class AccountSavedThingActivity extends BaseActivity implements ActivityToolbarInterface,
|
||||
PostLayoutBottomSheetFragment.PostLayoutSelectionCallback, MarkPostAsReadInterface {
|
||||
|
||||
@Inject
|
||||
@Named("oauth")
|
||||
Retrofit mOauthRetrofit;
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
|
@ -34,6 +34,7 @@ public interface LemmyAPI {
|
||||
@Query("sort") String sort,
|
||||
@Query("page") Integer page,
|
||||
@Query("limit") Integer limit,
|
||||
@Query("saved_only") Boolean saved_only,
|
||||
@Query("auth") String access_token);
|
||||
|
||||
@GET("api/v3/community/list")
|
||||
|
@ -252,7 +252,7 @@ public class PostPagingSource extends ListenableFuturePagingSource<Integer, Post
|
||||
|
||||
private ListenableFuture<LoadResult<Integer, Post>> loadUserPosts(@NonNull LoadParams<Integer> loadParams, LemmyAPI api) {
|
||||
ListenableFuture<Response<String>> userPosts;
|
||||
userPosts = api.getUserPosts(subredditOrUserName, sortType.getType().value,loadParams.getKey(),25,accessToken);
|
||||
userPosts = api.getUserPosts(subredditOrUserName, sortType.getType().value, loadParams.getKey(), 25, userWhere.equals(USER_WHERE_SAVED), accessToken);
|
||||
|
||||
|
||||
ListenableFuture<LoadResult<Integer, Post>> pageFuture = Futures.transform(userPosts, this::transformData, executor);
|
||||
|
Loading…
Reference in New Issue
Block a user