diff options
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 6 |
1 files changed, 4 insertions, 2 deletions
| @@ -2978,8 +2978,10 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, | |||
| 2978 | 2978 | ||
| 2979 | if (*fn != '\0') { | 2979 | if (*fn != '\0') { |
| 2980 | char *ext = strrchr(fn, '.'); | 2980 | char *ext = strrchr(fn, '.'); |
| 2981 | xs *hash = xs_md5_hex(fn, strlen(fn)); | 2981 | char rnd[32]; |
| 2982 | xs *id = xs_fmt("%s%s", hash, ext); | 2982 | xs_rnd_buf(rnd, sizeof(rnd)); |
| 2983 | xs *hash = xs_md5_hex(rnd, sizeof(rnd)); | ||
| 2984 | xs *id = xs_fmt("post-%s%s", hash, ext ? ext : ""); | ||
| 2983 | xs *url = xs_fmt("%s/s/%s", snac.actor, id); | 2985 | xs *url = xs_fmt("%s/s/%s", snac.actor, id); |
| 2984 | int fo = xs_number_get(xs_list_get(file, 1)); | 2986 | int fo = xs_number_get(xs_list_get(file, 1)); |
| 2985 | int fs = xs_number_get(xs_list_get(file, 2)); | 2987 | int fs = xs_number_get(xs_list_get(file, 2)); |