From 2fa4f87f0b0d8d9a4b4125fb9073ffd9b87aef8b Mon Sep 17 00:00:00 2001 From: nuclearfog Date: Thu, 9 Nov 2023 22:20:32 +0100 Subject: [PATCH] status reply fix --- .../twidda/backend/api/mastodon/Mastodon.java | 12 +++--------- .../twidda/ui/fragments/StatusFragment.java | 4 ++-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/org/nuclearfog/twidda/backend/api/mastodon/Mastodon.java b/app/src/main/java/org/nuclearfog/twidda/backend/api/mastodon/Mastodon.java index c0e47b8c..136c9200 100644 --- a/app/src/main/java/org/nuclearfog/twidda/backend/api/mastodon/Mastodon.java +++ b/app/src/main/java/org/nuclearfog/twidda/backend/api/mastodon/Mastodon.java @@ -643,15 +643,9 @@ public class Mastodon implements Connection { public Statuses getStatusReplies(long id, long minId, long maxId) throws MastodonException { Statuses statusThreads = getStatuses(ENDPOINT_STATUS + id + "/context", new ArrayList<>(0), minId, maxId); Statuses result = new Statuses(); - // fixme pagination broken - for (Status status : statusThreads) { - if (status != null && (minId == 0L || status.getId() > minId) && (maxId == 0L || status.getId() < maxId)) { - result.add(status); - if (result.size() == settings.getListSize()) { - break; - } - } - } + for (int i = 0; i < settings.getListSize(); i++) + result.add(statusThreads.get(i)); + result.setNextCursor(Statuses.NO_ID); return result; } diff --git a/app/src/main/java/org/nuclearfog/twidda/ui/fragments/StatusFragment.java b/app/src/main/java/org/nuclearfog/twidda/ui/fragments/StatusFragment.java index 708f37ab..72f03cce 100644 --- a/app/src/main/java/org/nuclearfog/twidda/ui/fragments/StatusFragment.java +++ b/app/src/main/java/org/nuclearfog/twidda/ui/fragments/StatusFragment.java @@ -260,9 +260,9 @@ public class StatusFragment extends ListFragment implements StatusSelectListener case MODE_REPLY: if (index == StatusAdapter.CLEAR_LIST) - request = new StatusLoader.Param(StatusLoader.Param.REPLIES_LOCAL, id, sinceId, maxId, index, search); + request = new StatusLoader.Param(StatusLoader.Param.REPLIES_LOCAL, id, sinceId, maxId, StatusAdapter.CLEAR_LIST, search); else - request = new StatusLoader.Param(StatusLoader.Param.REPLIES, id, sinceId, maxId, index, search); + request = new StatusLoader.Param(StatusLoader.Param.REPLIES, id, sinceId, maxId, StatusAdapter.CLEAR_LIST, search); break; case MODE_SEARCH: