diff options
| author | 2025-02-14 09:23:56 +0100 | |
|---|---|---|
| committer | 2025-02-14 09:23:56 +0100 | |
| commit | fc6a975f7b26aaa12136769be20b23a9f67e5a91 (patch) | |
| tree | 73f9cad64aa8aa08f6b2771b438b9c760b0c43d0 /html.c | |
| parent | Some variable renaming. (diff) | |
| download | snac2-fc6a975f7b26aaa12136769be20b23a9f67e5a91.tar.gz snac2-fc6a975f7b26aaa12136769be20b23a9f67e5a91.tar.xz snac2-fc6a975f7b26aaa12136769be20b23a9f67e5a91.zip | |
More variable renaming.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 52 |
1 files changed, 26 insertions, 26 deletions
| @@ -1091,16 +1091,16 @@ static xs_html *html_user_body(snac *user, int read_only) | |||
| 1091 | } | 1091 | } |
| 1092 | 1092 | ||
| 1093 | 1093 | ||
| 1094 | xs_html *html_top_controls(snac *snac) | 1094 | xs_html *html_top_controls(snac *user) |
| 1095 | /* generates the top controls */ | 1095 | /* generates the top controls */ |
| 1096 | { | 1096 | { |
| 1097 | xs *ops_action = xs_fmt("%s/admin/action", snac->actor); | 1097 | xs *ops_action = xs_fmt("%s/admin/action", user->actor); |
| 1098 | 1098 | ||
| 1099 | xs_html *top_controls = xs_html_tag("div", | 1099 | xs_html *top_controls = xs_html_tag("div", |
| 1100 | xs_html_attr("class", "snac-top-controls"), | 1100 | xs_html_attr("class", "snac-top-controls"), |
| 1101 | 1101 | ||
| 1102 | /** new post **/ | 1102 | /** new post **/ |
| 1103 | html_note(snac, L("New Post..."), | 1103 | html_note(user, L("New Post..."), |
| 1104 | "new_post_div", "new_post_form", | 1104 | "new_post_div", "new_post_form", |
| 1105 | L("What's on your mind?"), "", | 1105 | L("What's on your mind?"), "", |
| 1106 | NULL, NULL, | 1106 | NULL, NULL, |
| @@ -1170,53 +1170,53 @@ xs_html *html_top_controls(snac *snac) | |||
| 1170 | const char *email = "[disabled by admin]"; | 1170 | const char *email = "[disabled by admin]"; |
| 1171 | 1171 | ||
| 1172 | if (xs_type(xs_dict_get(srv_config, "disable_email_notifications")) != XSTYPE_TRUE) { | 1172 | if (xs_type(xs_dict_get(srv_config, "disable_email_notifications")) != XSTYPE_TRUE) { |
| 1173 | email = xs_dict_get(snac->config_o, "email"); | 1173 | email = xs_dict_get(user->config_o, "email"); |
| 1174 | if (xs_is_null(email)) { | 1174 | if (xs_is_null(email)) { |
| 1175 | email = xs_dict_get(snac->config, "email"); | 1175 | email = xs_dict_get(user->config, "email"); |
| 1176 | 1176 | ||
| 1177 | if (xs_is_null(email)) | 1177 | if (xs_is_null(email)) |
| 1178 | email = ""; | 1178 | email = ""; |
| 1179 | } | 1179 | } |
| 1180 | } | 1180 | } |
| 1181 | 1181 | ||
| 1182 | const char *cw = xs_dict_get(snac->config, "cw"); | 1182 | const char *cw = xs_dict_get(user->config, "cw"); |
| 1183 | if (xs_is_null(cw)) | 1183 | if (xs_is_null(cw)) |
| 1184 | cw = ""; | 1184 | cw = ""; |
| 1185 | 1185 | ||
| 1186 | const char *telegram_bot = xs_dict_get(snac->config, "telegram_bot"); | 1186 | const char *telegram_bot = xs_dict_get(user->config, "telegram_bot"); |
| 1187 | if (xs_is_null(telegram_bot)) | 1187 | if (xs_is_null(telegram_bot)) |
| 1188 | telegram_bot = ""; | 1188 | telegram_bot = ""; |
| 1189 | 1189 | ||
| 1190 | const char *telegram_chat_id = xs_dict_get(snac->config, "telegram_chat_id"); | 1190 | const char *telegram_chat_id = xs_dict_get(user->config, "telegram_chat_id"); |
| 1191 | if (xs_is_null(telegram_chat_id)) | 1191 | if (xs_is_null(telegram_chat_id)) |
| 1192 | telegram_chat_id = ""; | 1192 | telegram_chat_id = ""; |
| 1193 | 1193 | ||
| 1194 | const char *ntfy_server = xs_dict_get(snac->config, "ntfy_server"); | 1194 | const char *ntfy_server = xs_dict_get(user->config, "ntfy_server"); |
| 1195 | if (xs_is_null(ntfy_server)) | 1195 | if (xs_is_null(ntfy_server)) |
| 1196 | ntfy_server = ""; | 1196 | ntfy_server = ""; |
| 1197 | 1197 | ||
| 1198 | const char *ntfy_token = xs_dict_get(snac->config, "ntfy_token"); | 1198 | const char *ntfy_token = xs_dict_get(user->config, "ntfy_token"); |
| 1199 | if (xs_is_null(ntfy_token)) | 1199 | if (xs_is_null(ntfy_token)) |
| 1200 | ntfy_token = ""; | 1200 | ntfy_token = ""; |
| 1201 | 1201 | ||
| 1202 | const char *purge_days = xs_dict_get(snac->config, "purge_days"); | 1202 | const char *purge_days = xs_dict_get(user->config, "purge_days"); |
| 1203 | if (!xs_is_null(purge_days) && xs_type(purge_days) == XSTYPE_NUMBER) | 1203 | if (!xs_is_null(purge_days) && xs_type(purge_days) == XSTYPE_NUMBER) |
| 1204 | purge_days = (char *)xs_number_str(purge_days); | 1204 | purge_days = (char *)xs_number_str(purge_days); |
| 1205 | else | 1205 | else |
| 1206 | purge_days = "0"; | 1206 | purge_days = "0"; |
| 1207 | 1207 | ||
| 1208 | const xs_val *d_dm_f_u = xs_dict_get(snac->config, "drop_dm_from_unknown"); | 1208 | const xs_val *d_dm_f_u = xs_dict_get(user->config, "drop_dm_from_unknown"); |
| 1209 | const xs_val *bot = xs_dict_get(snac->config, "bot"); | 1209 | const xs_val *bot = xs_dict_get(user->config, "bot"); |
| 1210 | const xs_val *a_private = xs_dict_get(snac->config, "private"); | 1210 | const xs_val *a_private = xs_dict_get(user->config, "private"); |
| 1211 | const xs_val *auto_boost = xs_dict_get(snac->config, "auto_boost"); | 1211 | const xs_val *auto_boost = xs_dict_get(user->config, "auto_boost"); |
| 1212 | const xs_val *coll_thrds = xs_dict_get(snac->config, "collapse_threads"); | 1212 | const xs_val *coll_thrds = xs_dict_get(user->config, "collapse_threads"); |
| 1213 | const xs_val *pending = xs_dict_get(snac->config, "approve_followers"); | 1213 | const xs_val *pending = xs_dict_get(user->config, "approve_followers"); |
| 1214 | const xs_val *show_foll = xs_dict_get(snac->config, "show_contact_metrics"); | 1214 | const xs_val *show_foll = xs_dict_get(user->config, "show_contact_metrics"); |
| 1215 | const char *latitude = xs_dict_get_def(snac->config, "latitude", ""); | 1215 | const char *latitude = xs_dict_get_def(user->config, "latitude", ""); |
| 1216 | const char *longitude = xs_dict_get_def(snac->config, "longitude", ""); | 1216 | const char *longitude = xs_dict_get_def(user->config, "longitude", ""); |
| 1217 | 1217 | ||
| 1218 | xs *metadata = NULL; | 1218 | xs *metadata = NULL; |
| 1219 | const xs_dict *md = xs_dict_get(snac->config, "metadata"); | 1219 | const xs_dict *md = xs_dict_get(user->config, "metadata"); |
| 1220 | 1220 | ||
| 1221 | if (xs_type(md) == XSTYPE_DICT) { | 1221 | if (xs_type(md) == XSTYPE_DICT) { |
| 1222 | const xs_str *k; | 1222 | const xs_str *k; |
| @@ -1238,7 +1238,7 @@ xs_html *html_top_controls(snac *snac) | |||
| 1238 | else | 1238 | else |
| 1239 | metadata = xs_str_new(NULL); | 1239 | metadata = xs_str_new(NULL); |
| 1240 | 1240 | ||
| 1241 | xs *user_setup_action = xs_fmt("%s/admin/user-setup", snac->actor); | 1241 | xs *user_setup_action = xs_fmt("%s/admin/user-setup", user->actor); |
| 1242 | 1242 | ||
| 1243 | xs_html_add(top_controls, | 1243 | xs_html_add(top_controls, |
| 1244 | xs_html_tag("details", | 1244 | xs_html_tag("details", |
| @@ -1257,7 +1257,7 @@ xs_html *html_top_controls(snac *snac) | |||
| 1257 | xs_html_sctag("input", | 1257 | xs_html_sctag("input", |
| 1258 | xs_html_attr("type", "text"), | 1258 | xs_html_attr("type", "text"), |
| 1259 | xs_html_attr("name", "name"), | 1259 | xs_html_attr("name", "name"), |
| 1260 | xs_html_attr("value", xs_dict_get(snac->config, "name")), | 1260 | xs_html_attr("value", xs_dict_get(user->config, "name")), |
| 1261 | xs_html_attr("placeholder", L("Your name")))), | 1261 | xs_html_attr("placeholder", L("Your name")))), |
| 1262 | xs_html_tag("p", | 1262 | xs_html_tag("p", |
| 1263 | xs_html_text(L("Avatar: ")), | 1263 | xs_html_text(L("Avatar: ")), |
| @@ -1287,7 +1287,7 @@ xs_html *html_top_controls(snac *snac) | |||
| 1287 | xs_html_attr("cols", "40"), | 1287 | xs_html_attr("cols", "40"), |
| 1288 | xs_html_attr("rows", "4"), | 1288 | xs_html_attr("rows", "4"), |
| 1289 | xs_html_attr("placeholder", L("Write about yourself here...")), | 1289 | xs_html_attr("placeholder", L("Write about yourself here...")), |
| 1290 | xs_html_text(xs_dict_get(snac->config, "bio")))), | 1290 | xs_html_text(xs_dict_get(user->config, "bio")))), |
| 1291 | xs_html_sctag("input", | 1291 | xs_html_sctag("input", |
| 1292 | xs_html_attr("type", "checkbox"), | 1292 | xs_html_attr("type", "checkbox"), |
| 1293 | xs_html_attr("name", "cw"), | 1293 | xs_html_attr("name", "cw"), |
| @@ -1450,8 +1450,8 @@ xs_html *html_top_controls(snac *snac) | |||
| 1450 | 1450 | ||
| 1451 | xs_html_tag("p", NULL))))); | 1451 | xs_html_tag("p", NULL))))); |
| 1452 | 1452 | ||
| 1453 | xs *followed_hashtags_action = xs_fmt("%s/admin/followed-hashtags", snac->actor); | 1453 | xs *followed_hashtags_action = xs_fmt("%s/admin/followed-hashtags", user->actor); |
| 1454 | xs *followed_hashtags = xs_join(xs_dict_get_def(snac->config, | 1454 | xs *followed_hashtags = xs_join(xs_dict_get_def(user->config, |
| 1455 | "followed_hashtags", xs_stock(XSTYPE_LIST)), "\n"); | 1455 | "followed_hashtags", xs_stock(XSTYPE_LIST)), "\n"); |
| 1456 | 1456 | ||
| 1457 | xs_html_add(top_controls, | 1457 | xs_html_add(top_controls, |