status reply fix

This commit is contained in:
nuclearfog 2023-11-09 22:20:32 +01:00
parent 7231503aae
commit 2fa4f87f0b
No known key found for this signature in database
GPG Key ID: 03488A185C476379
2 changed files with 5 additions and 11 deletions

View File

@ -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;
}

View File

@ -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: