summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mastoapi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 08bb5f7..42f3a47 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -1397,6 +1397,9 @@ xs_list *mastoapi_timeline(snac *user, const xs_dict *args, const char *index_fn
1397 initial_status = index_desc_first(f, md5, 0); 1397 initial_status = index_desc_first(f, md5, 0);
1398 } 1398 }
1399 1399
1400 xs_set entries;
1401 xs_set_init(&entries);
1402
1400 if (initial_status) { 1403 if (initial_status) {
1401 do { 1404 do {
1402 xs *msg = NULL; 1405 xs *msg = NULL;
@@ -1488,7 +1491,7 @@ xs_list *mastoapi_timeline(snac *user, const xs_dict *args, const char *index_fn
1488 /* convert the Note into a Mastodon status */ 1491 /* convert the Note into a Mastodon status */
1489 xs *st = mastoapi_status(user, msg); 1492 xs *st = mastoapi_status(user, msg);
1490 1493
1491 if (st != NULL) { 1494 if (st != NULL && xs_set_add(&entries, md5) == 1) {
1492 if (ascending) 1495 if (ascending)
1493 out = xs_list_insert(out, 0, st); 1496 out = xs_list_insert(out, 0, st);
1494 else 1497 else
@@ -1499,6 +1502,8 @@ xs_list *mastoapi_timeline(snac *user, const xs_dict *args, const char *index_fn
1499 } while ((cnt < limit) && (*iterator)(f, md5)); 1502 } while ((cnt < limit) && (*iterator)(f, md5));
1500 } 1503 }
1501 1504
1505 xs_set_free(&entries);
1506
1502 int more = index_desc_next(f, md5); 1507 int more = index_desc_next(f, md5);
1503 1508
1504 fclose(f); 1509 fclose(f);