summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-07-05 14:06:21 +0200
committerdefault <nobody@localhost>2023-07-05 14:06:21 +0200
commiteef3c419dd11f324e4817cda0282d727b18d41d3 (patch)
tree38773040304d0469a2d4479e74ac8f7fd578caee /data.c
parent57ba1d575fdd92adc61dc0498ba3bc271cd7aa6e (diff)
Posts can be pinned/unpinned from the web interface.
Diffstat (limited to 'data.c')
-rw-r--r--data.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/data.c b/data.c
index c466598..bae85a1 100644
--- a/data.c
+++ b/data.c
@@ -901,11 +901,11 @@ int object_user_cache_in(snac *snac, const char *id, const char *cachedir)
}
-xs_list *object_user_cache_list(snac *snac, const char *cachedir, int max)
+xs_list *object_user_cache_list(snac *snac, const char *cachedir, int max, int inv)
/* returns the objects in a cache as a list */
{
xs *idx = xs_fmt("%s/%s.idx", snac->basedir, cachedir);
- return index_list(idx, max);
+ return inv ? index_list_desc(idx, 0, max) : index_list(idx, max);
}
@@ -945,7 +945,7 @@ int follower_check(snac *snac, const char *actor)
xs_list *follower_list(snac *snac)
/* returns the list of followers */
{
- xs *list = object_user_cache_list(snac, "followers", XS_ALL);
+ xs *list = object_user_cache_list(snac, "followers", XS_ALL, 0);
xs_list *fwers = xs_list_new();
char *p, *v;
@@ -1408,7 +1408,7 @@ int unpin(snac *user, const char *id)
xs_list *pinned_list(snac *user)
/* return the lists of pinned posts */
{
- return object_user_cache_list(user, "pinned", XS_ALL);
+ return object_user_cache_list(user, "pinned", XS_ALL, 1);
}