Browse Source

When reading timeline in ascending order, return results in descending order

Paul Martin 2 months ago
parent
commit
e6baf0d45c
1 changed files with 4 additions and 1 deletions
  1. 4 1
      mastoapi.c

+ 4 - 1
mastoapi.c

@@ -1453,7 +1453,10 @@ xs_list *mastoapi_timeline(snac *user, const xs_dict *args, const char *index_fn
             xs *st = mastoapi_status(user, msg);
 
             if (st != NULL) {
-                out = xs_list_append(out, st);
+                if (ascending)
+                    out = xs_list_insert(out, 0, st);
+                else
+                    out = xs_list_append(out, st);
                 cnt++;
             }