mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 22:45:05 +00:00
New function list_add_md5().
This commit is contained in:
parent
fa3904c5a7
commit
0c83ef5a22
1 changed files with 19 additions and 0 deletions
19
data.c
19
data.c
|
@ -288,6 +288,25 @@ int object_del(const char *id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int list_add_md5(const char *fn, const char *md5)
|
||||||
|
/* adds an md5 to a list */
|
||||||
|
{
|
||||||
|
int status = 200;
|
||||||
|
FILE *f;
|
||||||
|
|
||||||
|
if ((f = fopen(fn, "a")) != NULL) {
|
||||||
|
flock(fileno(f), LOCK_EX);
|
||||||
|
|
||||||
|
fprintf(f, "%s\n", md5);
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
status = 500;
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
d_char *_follower_fn(snac *snac, char *actor)
|
d_char *_follower_fn(snac *snac, char *actor)
|
||||||
{
|
{
|
||||||
xs *md5 = xs_md5_hex(actor, strlen(actor));
|
xs *md5 = xs_md5_hex(actor, strlen(actor));
|
||||||
|
|
Loading…
Reference in a new issue