fixed reply loader

This commit is contained in:
nuclearfog 2023-11-09 21:51:38 +01:00
parent debf562d31
commit 7231503aae
No known key found for this signature in database
GPG Key ID: 03488A185C476379
2 changed files with 6 additions and 3 deletions

View File

@ -643,7 +643,7 @@ 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();
// todo add option to toggle viewing whole thread
// fixme pagination broken
for (Status status : statusThreads) {
if (status != null && (minId == 0L || status.getId() > minId) && (maxId == 0L || status.getId() < maxId)) {
result.add(status);
@ -1520,7 +1520,8 @@ public class Mastodon implements Connection {
params.add("limit=" + settings.getListSize());
try {
Statuses result = createStatuses(get(endpoint, params));
if (result.size() > 1)
// posts from reply endpoint should not be sorted
if (result.size() > 1 && !endpoint.endsWith("/context"))
Collections.sort(result);
return result;
} catch (IOException e) {

View File

@ -713,7 +713,9 @@ public class AppDatabase {
SQLiteDatabase db = adapter.getDbRead();
Cursor cursor = db.rawQuery(REPLY_QUERY, args);
return getStatuses(cursor, db);
Statuses result = getStatuses(cursor, db);
result.setNextCursor(Statuses.NO_ID);
return result;
}
}