summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
Diffstat (limited to 'html.c')
-rw-r--r--html.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/html.c b/html.c
index 5407e22..95957a2 100644
--- a/html.c
+++ b/html.c
@@ -646,7 +646,7 @@ xs_html *html_user_head(snac *user, char *desc)
646} 646}
647 647
648 648
649static xs_html *html_user_body(snac *user, int local) 649static 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
1309xs_html *html_entry(snac *user, xs_dict *msg, int local, 1309xs_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)