commit 6f884e0

default  ·  2025-04-06 05:50:51 +0000 UTC
parent 7f7d42c
The avatar and header images have a prefix in their names.
1 files changed,  +3, -3
M html.c
M html.c
+3, -3
 1@@ -4290,9 +4290,9 @@ int html_post_handler(const xs_dict *req, const char *q_path,
 2                     char rnd[32];
 3                     xs_rnd_buf(rnd, sizeof(rnd));
 4 
 5-                    char *ext = strrchr(fn, '.');
 6+                    const char *ext = strrchr(fn, '.');
 7                     xs *hash  = xs_md5_hex(rnd, strlen(rnd));
 8-                    xs *id    = xs_fmt("p-%s%s", hash, ext ? ext : "");
 9+                    xs *id    = xs_fmt("post-%s%s", hash, ext ? ext : "");
10                     xs *url   = xs_fmt("%s/s/%s", snac.actor, id);
11                     int fo    = xs_number_get(xs_list_get(attach_file, 1));
12                     int fs    = xs_number_get(xs_list_get(attach_file, 2));
13@@ -4764,7 +4764,7 @@ int html_post_handler(const xs_dict *req, const char *q_path,
14                     if (xs_startswith(mimetype, "image/")) {
15                         const char *ext = strrchr(fn, '.');
16                         xs *hash        = xs_md5_hex(fn, strlen(fn));
17-                        xs *id          = xs_fmt("%s%s", hash, ext);
18+                        xs *id          = xs_fmt("%s-%s%s", uploads[n], hash, ext ? ext : "");
19                         xs *url         = xs_fmt("%s/s/%s", snac.actor, id);
20                         int fo          = xs_number_get(xs_list_get(uploaded_file, 1));
21                         int fs          = xs_number_get(xs_list_get(uploaded_file, 2));