diff options
| author | 2025-02-14 10:04:46 +0100 | |
|---|---|---|
| committer | 2025-02-14 10:04:46 +0100 | |
| commit | 02bc18eb118fcd93f5cd90a056f7b78dfe64382f (patch) | |
| tree | affa271a87beccf836280de278c7b7cddd2ed308 | |
| parent | New function lang_str(). (diff) | |
| download | penes-snac2-02bc18eb118fcd93f5cd90a056f7b78dfe64382f.tar.gz penes-snac2-02bc18eb118fcd93f5cd90a056f7b78dfe64382f.tar.xz penes-snac2-02bc18eb118fcd93f5cd90a056f7b78dfe64382f.zip | |
Redefined L() to use lang_str().
Diffstat (limited to '')
| -rw-r--r-- | html.c | 15 | ||||
| -rw-r--r-- | httpd.c | 2 | ||||
| -rw-r--r-- | snac.h | 2 |
3 files changed, 16 insertions, 3 deletions
| @@ -627,6 +627,9 @@ static xs_html *html_instance_body(void) | |||
| 627 | const char *email = xs_dict_get(srv_config, "admin_email"); | 627 | const char *email = xs_dict_get(srv_config, "admin_email"); |
| 628 | const char *acct = xs_dict_get(srv_config, "admin_account"); | 628 | const char *acct = xs_dict_get(srv_config, "admin_account"); |
| 629 | 629 | ||
| 630 | /* for L() */ | ||
| 631 | const snac *user = NULL; | ||
| 632 | |||
| 630 | xs *blurb = xs_replace(snac_blurb, "%host%", host); | 633 | xs *blurb = xs_replace(snac_blurb, "%host%", host); |
| 631 | 634 | ||
| 632 | xs_html *dl; | 635 | xs_html *dl; |
| @@ -1486,7 +1489,7 @@ xs_html *html_top_controls(snac *user) | |||
| 1486 | } | 1489 | } |
| 1487 | 1490 | ||
| 1488 | 1491 | ||
| 1489 | static xs_html *html_button(char *clss, char *label, char *hint) | 1492 | static xs_html *html_button(const char *clss, const char *label, const char *hint) |
| 1490 | { | 1493 | { |
| 1491 | xs *c = xs_fmt("snac-btn-%s", clss); | 1494 | xs *c = xs_fmt("snac-btn-%s", clss); |
| 1492 | 1495 | ||
| @@ -2584,6 +2587,8 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 2584 | 2587 | ||
| 2585 | xs_html *html_footer(void) | 2588 | xs_html *html_footer(void) |
| 2586 | { | 2589 | { |
| 2590 | const snac *user = NULL; | ||
| 2591 | |||
| 2587 | return xs_html_tag("div", | 2592 | return xs_html_tag("div", |
| 2588 | xs_html_attr("class", "snac-footer"), | 2593 | xs_html_attr("class", "snac-footer"), |
| 2589 | xs_html_tag("a", | 2594 | xs_html_tag("a", |
| @@ -2896,7 +2901,7 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only, | |||
| 2896 | } | 2901 | } |
| 2897 | 2902 | ||
| 2898 | 2903 | ||
| 2899 | xs_html *html_people_list(snac *user, xs_list *list, char *header, char *t, const char *proxy) | 2904 | xs_html *html_people_list(snac *user, xs_list *list, const char *header, const char *t, const char *proxy) |
| 2900 | { | 2905 | { |
| 2901 | xs_html *snac_posts; | 2906 | xs_html *snac_posts; |
| 2902 | xs_html *people = xs_html_tag("div", | 2907 | xs_html *people = xs_html_tag("div", |
| @@ -3327,6 +3332,7 @@ int html_get_handler(const xs_dict *req, const char *q_path, | |||
| 3327 | { | 3332 | { |
| 3328 | const char *accept = xs_dict_get(req, "accept"); | 3333 | const char *accept = xs_dict_get(req, "accept"); |
| 3329 | int status = HTTP_STATUS_NOT_FOUND; | 3334 | int status = HTTP_STATUS_NOT_FOUND; |
| 3335 | const snac *user = NULL; | ||
| 3330 | snac snac; | 3336 | snac snac; |
| 3331 | xs *uid = NULL; | 3337 | xs *uid = NULL; |
| 3332 | const char *p_path; | 3338 | const char *p_path; |
| @@ -3393,6 +3399,8 @@ int html_get_handler(const xs_dict *req, const char *q_path, | |||
| 3393 | return HTTP_STATUS_NOT_FOUND; | 3399 | return HTTP_STATUS_NOT_FOUND; |
| 3394 | } | 3400 | } |
| 3395 | 3401 | ||
| 3402 | user = &snac; | ||
| 3403 | |||
| 3396 | if (xs_is_true(xs_dict_get(srv_config, "proxy_media"))) | 3404 | if (xs_is_true(xs_dict_get(srv_config, "proxy_media"))) |
| 3397 | proxy = 1; | 3405 | proxy = 1; |
| 3398 | 3406 | ||
| @@ -4016,6 +4024,7 @@ int html_post_handler(const xs_dict *req, const char *q_path, | |||
| 4016 | (void)ctype; | 4024 | (void)ctype; |
| 4017 | 4025 | ||
| 4018 | int status = 0; | 4026 | int status = 0; |
| 4027 | const snac *user = NULL; | ||
| 4019 | snac snac; | 4028 | snac snac; |
| 4020 | const char *uid; | 4029 | const char *uid; |
| 4021 | const char *p_path; | 4030 | const char *p_path; |
| @@ -4039,6 +4048,8 @@ int html_post_handler(const xs_dict *req, const char *q_path, | |||
| 4039 | return HTTP_STATUS_UNAUTHORIZED; | 4048 | return HTTP_STATUS_UNAUTHORIZED; |
| 4040 | } | 4049 | } |
| 4041 | 4050 | ||
| 4051 | user = &snac; | ||
| 4052 | |||
| 4042 | p_vars = xs_dict_get(req, "p_vars"); | 4053 | p_vars = xs_dict_get(req, "p_vars"); |
| 4043 | 4054 | ||
| 4044 | if (p_path && strcmp(p_path, "admin/note") == 0) { /** **/ | 4055 | if (p_path && strcmp(p_path, "admin/note") == 0) { /** **/ |
| @@ -211,6 +211,8 @@ int server_get_handler(xs_dict *req, const char *q_path, | |||
| 211 | { | 211 | { |
| 212 | int status = 0; | 212 | int status = 0; |
| 213 | 213 | ||
| 214 | const snac *user = NULL; | ||
| 215 | |||
| 214 | /* is it the server root? */ | 216 | /* is it the server root? */ |
| 215 | if (*q_path == '\0' || strcmp(q_path, "/") == 0) { | 217 | if (*q_path == '\0' || strcmp(q_path, "/") == 0) { |
| 216 | const xs_dict *q_vars = xs_dict_get(req, "q_vars"); | 218 | const xs_dict *q_vars = xs_dict_get(req, "q_vars"); |
| @@ -37,7 +37,7 @@ extern xs_dict *srv_langs; | |||
| 37 | 37 | ||
| 38 | extern int dbglevel; | 38 | extern int dbglevel; |
| 39 | 39 | ||
| 40 | #define L(s) (s) | 40 | #define L(s) lang_str((s), user) |
| 41 | 41 | ||
| 42 | #define POSTLIKE_OBJECT_TYPE "Note|Question|Page|Article|Video|Audio|Event" | 42 | #define POSTLIKE_OBJECT_TYPE "Note|Question|Page|Article|Video|Audio|Event" |
| 43 | 43 | ||