diff options
| author | default <nobody@localhost> | 2024-09-18 12:12:58 +0200 |
|---|---|---|
| committer | default <nobody@localhost> | 2024-09-18 12:12:58 +0200 |
| commit | 748d60497fb6cdcc3fbc0a9dbd3bc812045ba85f (patch) | |
| tree | efa0977e7216f1252669139071c45c2aef8dcdae /data.c | |
| parent | 5f5d4be347fdde2d1ceb3df9692af3dcfe551bcc (diff) | |
Started support for CSV data export.
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -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) |