Browse Source

Merge pull request 'When reading timeline in ascending order, return results in descending order' (#284) from nowster/snac2:min_id_reverse into master

Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/284
grunfink 2 months ago
parent
commit
e34febac8c
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++;
             }