diff options
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) |