summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-10-01 09:12:33 +0200
committerdefault <nobody@localhost>2022-10-01 09:12:33 +0200
commit2c00c7b0b585867495a505a9daf3ab48aa1dfa0b (patch)
treeba3d8f3619f80ab269a24da861ebb38c7056581d /data.c
parent1bb52559b2de8d896ad2e3a4c2fd4207c460733f (diff)
New web action 'Unfollow'.
Diffstat (limited to 'data.c')
-rw-r--r--data.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/data.c b/data.c
index 9051810..4ff5a84 100644
--- a/data.c
+++ b/data.c
@@ -693,6 +693,27 @@ int following_check(snac *snac, char *actor)
}
+int following_get(snac *snac, char *actor, d_char **data)
+/* returns the 'Follow' object */
+{
+ xs *fn = _following_fn(snac, actor);
+ FILE *f;
+ int status = 200;
+
+ if ((f = fopen(fn, "r")) != NULL) {
+ xs *j = xs_readall(f);
+
+ fclose(f);
+
+ *data = xs_json_loads(j);
+ }
+ else
+ status = 404;
+
+ return status;
+}
+
+
d_char *_muted_fn(snac *snac, char *actor)
{
xs *md5 = xs_md5_hex(actor, strlen(actor));