diff options
| author | default <nobody@localhost> | 2024-11-24 08:17:38 +0100 |
|---|---|---|
| committer | default <nobody@localhost> | 2024-11-24 08:17:38 +0100 |
| commit | 7287776fd1f659619e211ee482ba0d6d64ddbf0b (patch) | |
| tree | 26d4c501947a86d294080730db38ee052ce658d3 /data.c | |
| parent | 35b35ec3afff47be872004448e6ba81a6a339131 (diff) | |
New function pending_add().
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -1202,6 +1202,28 @@ xs_list *follower_list(snac *snac) } +/** pending followers **/ + +int pending_add(snac *user, const char *actor, const xs_dict *msg) +/* stores the follow message for later confirmation */ +{ + xs *dir = xs_fmt("%s/pending", user->basedir); + xs *md5 = xs_md5_hex(actor, strlen(actor)); + xs *fn = xs_fmt("%s/%s.json", dir, md5); + FILE *f; + + mkdirx(dir); + + if ((f = fopen(fn, "w")) == NULL) + return -1; + + xs_json_dump(msg, 4, f); + fclose(f); + + return 0; +} + + /** timeline **/ double timeline_mtime(snac *snac) |