summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-09-28 04:48:23 +0200
committerdefault <nobody@localhost>2022-09-28 04:48:23 +0200
commit32661d2be7bb718522c123e401ef35fa0307c1c0 (patch)
tree9b99dbdad9ba918090847131014dc524f264504e /data.c
parent94ef803701d7a7596a5347a8b9af6c586b795c92 (diff)
The outbox returns now some entries.
Diffstat (limited to 'data.c')
-rw-r--r--data.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/data.c b/data.c
index 97cf8b4..6ea1bae 100644
--- a/data.c
+++ b/data.c
@@ -357,16 +357,19 @@ d_char *timeline_get(snac *snac, char *fn)
}
-d_char *timeline_list(snac *snac)
+d_char *_timeline_list(snac *snac, char *directory, int max)
/* returns a list of the timeline filenames */
{
d_char *list;
- xs *spec = xs_fmt("%s/timeline/" "*.json", snac->basedir);
+ xs *spec = xs_fmt("%s/%s/" "*.json", snac->basedir, directory);
glob_t globbuf;
- int max;
+ int c_max;
/* maximum number of items in the timeline */
- max = xs_number_get(xs_dict_get(srv_config, "max_timeline_entries"));
+ c_max = xs_number_get(xs_dict_get(srv_config, "max_timeline_entries"));
+
+ if (max > c_max)
+ max = c_max;
list = xs_list_new();
@@ -390,6 +393,18 @@ d_char *timeline_list(snac *snac)
}
+d_char *timeline_list(snac *snac, int max)
+{
+ return _timeline_list(snac, "timeline", max);
+}
+
+
+d_char *local_list(snac *snac, int max)
+{
+ return _timeline_list(snac, "local", max);
+}
+
+
d_char *_timeline_new_fn(snac *snac, char *id)
/* creates a new filename */
{