diff options
| author | 2024-02-21 08:00:03 +0100 | |
|---|---|---|
| committer | 2024-02-21 08:00:03 +0100 | |
| commit | 2b814287fd89941f275c478e7e3d51af6bf72775 (patch) | |
| tree | e1f131510ecfdaaff995c47edddd159c4acf17eb | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | snac2-2b814287fd89941f275c478e7e3d51af6bf72775.tar.gz snac2-2b814287fd89941f275c478e7e3d51af6bf72775.tar.xz snac2-2b814287fd89941f275c478e7e3d51af6bf72775.zip | |
Renamed 'local' argument to 'read_only', as it was a bit confusing.
| -rw-r--r-- | html.c | 26 |
1 files changed, 13 insertions, 13 deletions
| @@ -646,7 +646,7 @@ xs_html *html_user_head(snac *user, char *desc) | |||
| 646 | } | 646 | } |
| 647 | 647 | ||
| 648 | 648 | ||
| 649 | static xs_html *html_user_body(snac *user, int local) | 649 | static xs_html *html_user_body(snac *user, int read_only) |
| 650 | { | 650 | { |
| 651 | xs_html *body = xs_html_tag("body", NULL); | 651 | xs_html *body = xs_html_tag("body", NULL); |
| 652 | 652 | ||
| @@ -667,7 +667,7 @@ static xs_html *html_user_body(snac *user, int local) | |||
| 667 | xs_html_attr("class", "snac-avatar"), | 667 | xs_html_attr("class", "snac-avatar"), |
| 668 | xs_html_attr("alt", ""))); | 668 | xs_html_attr("alt", ""))); |
| 669 | 669 | ||
| 670 | if (local) { | 670 | if (read_only) { |
| 671 | xs *rss_url = xs_fmt("%s.rss", user->actor); | 671 | xs *rss_url = xs_fmt("%s.rss", user->actor); |
| 672 | xs *admin_url = xs_fmt("%s/admin", user->actor); | 672 | xs *admin_url = xs_fmt("%s/admin", user->actor); |
| 673 | 673 | ||
| @@ -724,7 +724,7 @@ static xs_html *html_user_body(snac *user, int local) | |||
| 724 | xs_html *top_user = xs_html_tag("div", | 724 | xs_html *top_user = xs_html_tag("div", |
| 725 | xs_html_attr("class", "h-card snac-top-user")); | 725 | xs_html_attr("class", "h-card snac-top-user")); |
| 726 | 726 | ||
| 727 | if (local) { | 727 | if (read_only) { |
| 728 | char *header = xs_dict_get(user->config, "header"); | 728 | char *header = xs_dict_get(user->config, "header"); |
| 729 | if (header && *header) { | 729 | if (header && *header) { |
| 730 | xs_html_add(top_user, | 730 | xs_html_add(top_user, |
| @@ -749,7 +749,7 @@ static xs_html *html_user_body(snac *user, int local) | |||
| 749 | xs_html_attr("class", "snac-top-user-id"), | 749 | xs_html_attr("class", "snac-top-user-id"), |
| 750 | xs_html_text(handle))); | 750 | xs_html_text(handle))); |
| 751 | 751 | ||
| 752 | if (local) { | 752 | if (read_only) { |
| 753 | xs *es1 = encode_html(xs_dict_get(user->config, "bio")); | 753 | xs *es1 = encode_html(xs_dict_get(user->config, "bio")); |
| 754 | xs *bio1 = not_really_markdown(es1, NULL); | 754 | xs *bio1 = not_really_markdown(es1, NULL); |
| 755 | xs *tags = xs_list_new(); | 755 | xs *tags = xs_list_new(); |
| @@ -1306,7 +1306,7 @@ xs_html *html_entry_controls(snac *snac, char *actor, const xs_dict *msg, const | |||
| 1306 | } | 1306 | } |
| 1307 | 1307 | ||
| 1308 | 1308 | ||
| 1309 | xs_html *html_entry(snac *user, xs_dict *msg, int local, | 1309 | xs_html *html_entry(snac *user, xs_dict *msg, int read_only, |
| 1310 | int level, char *md5, int hide_children) | 1310 | int level, char *md5, int hide_children) |
| 1311 | { | 1311 | { |
| 1312 | char *id = xs_dict_get(msg, "id"); | 1312 | char *id = xs_dict_get(msg, "id"); |
| @@ -1315,7 +1315,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int local, | |||
| 1315 | char *v; | 1315 | char *v; |
| 1316 | 1316 | ||
| 1317 | /* do not show non-public messages in the public timeline */ | 1317 | /* do not show non-public messages in the public timeline */ |
| 1318 | if ((local || !user) && !is_msg_public(msg)) | 1318 | if ((read_only || !user) && !is_msg_public(msg)) |
| 1319 | return NULL; | 1319 | return NULL; |
| 1320 | 1320 | ||
| 1321 | /* hidden? do nothing more for this conversation */ | 1321 | /* hidden? do nothing more for this conversation */ |
| @@ -1334,7 +1334,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int local, | |||
| 1334 | xs_html_tag("div", | 1334 | xs_html_tag("div", |
| 1335 | xs_html_attr("class", "snac-origin"), | 1335 | xs_html_attr("class", "snac-origin"), |
| 1336 | xs_html_text(L("follows you"))), | 1336 | xs_html_text(L("follows you"))), |
| 1337 | html_msg_icon(local ? NULL : user, xs_dict_get(msg, "actor"), msg))); | 1337 | html_msg_icon(read_only ? NULL : user, xs_dict_get(msg, "actor"), msg))); |
| 1338 | } | 1338 | } |
| 1339 | else | 1339 | else |
| 1340 | if (!xs_match(type, "Note|Question|Page|Article|Video")) { | 1340 | if (!xs_match(type, "Note|Question|Page|Article|Video")) { |
| @@ -1446,7 +1446,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int local, | |||
| 1446 | if (!xs_is_null(name)) { | 1446 | if (!xs_is_null(name)) { |
| 1447 | xs *href = NULL; | 1447 | xs *href = NULL; |
| 1448 | 1448 | ||
| 1449 | if (!local && user != NULL) | 1449 | if (!read_only && user != NULL) |
| 1450 | href = xs_fmt("%s/people#%s", user->actor, p); | 1450 | href = xs_fmt("%s/people#%s", user->actor, p); |
| 1451 | else | 1451 | else |
| 1452 | href = xs_dup(xs_dict_get(actor_r, "id")); | 1452 | href = xs_dup(xs_dict_get(actor_r, "id")); |
| @@ -1482,7 +1482,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int local, | |||
| 1482 | } | 1482 | } |
| 1483 | 1483 | ||
| 1484 | xs_html_add(post_header, | 1484 | xs_html_add(post_header, |
| 1485 | html_msg_icon(local ? NULL : user, actor, msg)); | 1485 | html_msg_icon(read_only ? NULL : user, actor, msg)); |
| 1486 | 1486 | ||
| 1487 | /** post content **/ | 1487 | /** post content **/ |
| 1488 | 1488 | ||
| @@ -1510,7 +1510,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int local, | |||
| 1510 | 1510 | ||
| 1511 | /* only show it when not in the public timeline and the config setting is "open" */ | 1511 | /* only show it when not in the public timeline and the config setting is "open" */ |
| 1512 | char *cw = xs_dict_get(user->config, "cw"); | 1512 | char *cw = xs_dict_get(user->config, "cw"); |
| 1513 | if (xs_is_null(cw) || local) | 1513 | if (xs_is_null(cw) || read_only) |
| 1514 | cw = ""; | 1514 | cw = ""; |
| 1515 | 1515 | ||
| 1516 | snac_content = xs_html_tag("details", | 1516 | snac_content = xs_html_tag("details", |
| @@ -1574,7 +1574,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int local, | |||
| 1574 | 1574 | ||
| 1575 | xs_html *poll = xs_html_tag("div", NULL); | 1575 | xs_html *poll = xs_html_tag("div", NULL); |
| 1576 | 1576 | ||
| 1577 | if (local) | 1577 | if (read_only) |
| 1578 | closed = 1; /* non-identified page; show as closed */ | 1578 | closed = 1; /* non-identified page; show as closed */ |
| 1579 | else | 1579 | else |
| 1580 | if (xs_dict_get(msg, "closed")) | 1580 | if (xs_dict_get(msg, "closed")) |
| @@ -1795,7 +1795,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int local, | |||
| 1795 | 1795 | ||
| 1796 | /** controls **/ | 1796 | /** controls **/ |
| 1797 | 1797 | ||
| 1798 | if (!local && user) { | 1798 | if (!read_only && user) { |
| 1799 | xs_html_add(entry, | 1799 | xs_html_add(entry, |
| 1800 | html_entry_controls(user, actor, msg, md5)); | 1800 | html_entry_controls(user, actor, msg, md5)); |
| 1801 | } | 1801 | } |
| @@ -1839,7 +1839,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int local, | |||
| 1839 | object_get_by_md5(cmd5, &chd); | 1839 | object_get_by_md5(cmd5, &chd); |
| 1840 | 1840 | ||
| 1841 | if (chd != NULL && xs_is_null(xs_dict_get(chd, "name"))) { | 1841 | if (chd != NULL && xs_is_null(xs_dict_get(chd, "name"))) { |
| 1842 | xs_html *che = html_entry(user, chd, local, level + 1, cmd5, hide_children); | 1842 | xs_html *che = html_entry(user, chd, read_only, level + 1, cmd5, hide_children); |
| 1843 | 1843 | ||
| 1844 | if (che != NULL) { | 1844 | if (che != NULL) { |
| 1845 | if (left > 3) | 1845 | if (left > 3) |