commit 02bc18e
default
·
2025-02-14 09:04:46 +0000 UTC
parent 9a56475
Redefined L() to use lang_str().
M
html.c
+13,
-2
1@@ -627,6 +627,9 @@ static xs_html *html_instance_body(void)
2 const char *email = xs_dict_get(srv_config, "admin_email");
3 const char *acct = xs_dict_get(srv_config, "admin_account");
4
5+ /* for L() */
6+ const snac *user = NULL;
7+
8 xs *blurb = xs_replace(snac_blurb, "%host%", host);
9
10 xs_html *dl;
11@@ -1486,7 +1489,7 @@ xs_html *html_top_controls(snac *user)
12 }
13
14
15-static xs_html *html_button(char *clss, char *label, char *hint)
16+static xs_html *html_button(const char *clss, const char *label, const char *hint)
17 {
18 xs *c = xs_fmt("snac-btn-%s", clss);
19
20@@ -2584,6 +2587,8 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
21
22 xs_html *html_footer(void)
23 {
24+ const snac *user = NULL;
25+
26 return xs_html_tag("div",
27 xs_html_attr("class", "snac-footer"),
28 xs_html_tag("a",
29@@ -2896,7 +2901,7 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only,
30 }
31
32
33-xs_html *html_people_list(snac *user, xs_list *list, char *header, char *t, const char *proxy)
34+xs_html *html_people_list(snac *user, xs_list *list, const char *header, const char *t, const char *proxy)
35 {
36 xs_html *snac_posts;
37 xs_html *people = xs_html_tag("div",
38@@ -3327,6 +3332,7 @@ int html_get_handler(const xs_dict *req, const char *q_path,
39 {
40 const char *accept = xs_dict_get(req, "accept");
41 int status = HTTP_STATUS_NOT_FOUND;
42+ const snac *user = NULL;
43 snac snac;
44 xs *uid = NULL;
45 const char *p_path;
46@@ -3393,6 +3399,8 @@ int html_get_handler(const xs_dict *req, const char *q_path,
47 return HTTP_STATUS_NOT_FOUND;
48 }
49
50+ user = &snac;
51+
52 if (xs_is_true(xs_dict_get(srv_config, "proxy_media")))
53 proxy = 1;
54
55@@ -4016,6 +4024,7 @@ int html_post_handler(const xs_dict *req, const char *q_path,
56 (void)ctype;
57
58 int status = 0;
59+ const snac *user = NULL;
60 snac snac;
61 const char *uid;
62 const char *p_path;
63@@ -4039,6 +4048,8 @@ int html_post_handler(const xs_dict *req, const char *q_path,
64 return HTTP_STATUS_UNAUTHORIZED;
65 }
66
67+ user = &snac;
68+
69 p_vars = xs_dict_get(req, "p_vars");
70
71 if (p_path && strcmp(p_path, "admin/note") == 0) { /** **/
M
httpd.c
+2,
-0
1@@ -211,6 +211,8 @@ int server_get_handler(xs_dict *req, const char *q_path,
2 {
3 int status = 0;
4
5+ const snac *user = NULL;
6+
7 /* is it the server root? */
8 if (*q_path == '\0' || strcmp(q_path, "/") == 0) {
9 const xs_dict *q_vars = xs_dict_get(req, "q_vars");
M
snac.h
+1,
-1
1@@ -37,7 +37,7 @@ extern xs_dict *srv_langs;
2
3 extern int dbglevel;
4
5-#define L(s) (s)
6+#define L(s) lang_str((s), user)
7
8 #define POSTLIKE_OBJECT_TYPE "Note|Question|Page|Article|Video|Audio|Event"
9