diff options
author | default <nobody@localhost> | 2024-05-07 19:40:28 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2024-05-07 19:40:28 +0200 |
commit | 6b1721c977294ee28f54150579c36514aa3ee62a (patch) | |
tree | 9ebd8169f90ce7f46485221d4c6b33ea515c8f21 /data.c | |
parent | c5ae10af862d3c76c79e848fc4dbe69f80cfc214 (diff) |
List timelines can now be (manually) navigated from the web UI.
URLs are {srv_baseurl}/{user}/list/{list_id} (you must know the list id).
Diffstat (limited to 'data.c')
-rw-r--r-- | data.c | 24 |
1 files changed, 19 insertions, 5 deletions
@@ -1836,6 +1836,23 @@ xs_val *list_maint(snac *user, const char *list, int op) } +xs_list *list_timeline(snac *user, const char *list, int skip, int show) +/* returns the timeline of a list */ +{ + xs_list *l = NULL; + + if (!xs_is_hex(list)) + return NULL; + + xs *fn = xs_fmt("%s/list/%s.idx", user->basedir, list); + + if (mtime(fn) > 0.0) + l = index_list_desc(fn, skip, show); + + return l; +} + + xs_val *list_content(snac *user, const char *list, const char *actor_md5, int op) /* list content management */ { @@ -1869,11 +1886,8 @@ xs_val *list_content(snac *user, const char *list, const char *actor_md5, int op break; - case 3: /** list timeline **/ - fn = xs_replace_i(fn, ".lst", ".idx"); - - l = index_list_desc(fn, 0, 2048); - + default: + srv_log(xs_fmt("ERROR: list_content: bad op %d", op)); break; } |