aboutsummaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-09-18 12:12:58 +0200
committerdefault <nobody@localhost>2024-09-18 12:12:58 +0200
commit748d60497fb6cdcc3fbc0a9dbd3bc812045ba85f (patch)
treeefa0977e7216f1252669139071c45c2aef8dcdae /data.c
parent5f5d4be347fdde2d1ceb3df9692af3dcfe551bcc (diff)
Started support for CSV data export.
Diffstat (limited to 'data.c')
-rw-r--r--data.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/data.c b/data.c
index b8d8332..ded3c42 100644
--- a/data.c
+++ b/data.c
@@ -1574,6 +1574,29 @@ int is_muted(snac *snac, const char *actor)
}
+xs_list *muted_list(snac *user)
+/* returns the list (actor URLs) of the muted morons */
+{
+ xs_list *l = xs_list_new();
+ xs *spec = xs_fmt("%s/muted/" "*", user->basedir);
+ xs *files = xs_glob(spec, 0, 0);
+ const char *fn;
+
+ xs_list_foreach(files, fn) {
+ FILE *f;
+
+ if ((f = fopen(fn, "r")) != NULL) {
+ xs *actor = xs_strip_i(xs_readline(f));
+ fclose(f);
+
+ l = xs_list_append(l, actor);
+ }
+ }
+
+ return l;
+}
+
+
/** bookmarking **/
int is_bookmarked(snac *user, const char *id)