diff options
| author | 2024-09-18 12:12:58 +0200 | |
|---|---|---|
| committer | 2024-09-18 12:12:58 +0200 | |
| commit | 748d60497fb6cdcc3fbc0a9dbd3bc812045ba85f (patch) | |
| tree | efa0977e7216f1252669139071c45c2aef8dcdae /data.c | |
| parent | Use user_persist() to publish the actor after setting the aka. (diff) | |
| download | snac2-748d60497fb6cdcc3fbc0a9dbd3bc812045ba85f.tar.gz snac2-748d60497fb6cdcc3fbc0a9dbd3bc812045ba85f.tar.xz snac2-748d60497fb6cdcc3fbc0a9dbd3bc812045ba85f.zip | |
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) | |||
| 1574 | } | 1574 | } |
| 1575 | 1575 | ||
| 1576 | 1576 | ||
| 1577 | xs_list *muted_list(snac *user) | ||
| 1578 | /* returns the list (actor URLs) of the muted morons */ | ||
| 1579 | { | ||
| 1580 | xs_list *l = xs_list_new(); | ||
| 1581 | xs *spec = xs_fmt("%s/muted/" "*", user->basedir); | ||
| 1582 | xs *files = xs_glob(spec, 0, 0); | ||
| 1583 | const char *fn; | ||
| 1584 | |||
| 1585 | xs_list_foreach(files, fn) { | ||
| 1586 | FILE *f; | ||
| 1587 | |||
| 1588 | if ((f = fopen(fn, "r")) != NULL) { | ||
| 1589 | xs *actor = xs_strip_i(xs_readline(f)); | ||
| 1590 | fclose(f); | ||
| 1591 | |||
| 1592 | l = xs_list_append(l, actor); | ||
| 1593 | } | ||
| 1594 | } | ||
| 1595 | |||
| 1596 | return l; | ||
| 1597 | } | ||
| 1598 | |||
| 1599 | |||
| 1577 | /** bookmarking **/ | 1600 | /** bookmarking **/ |
| 1578 | 1601 | ||
| 1579 | int is_bookmarked(snac *user, const char *id) | 1602 | int is_bookmarked(snac *user, const char *id) |