summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2025-02-14 09:29:37 +0100
committerGravatar default2025-02-14 09:29:37 +0100
commit866050306a94f5484bc1bfb3dc20d8761f9bb161 (patch)
tree9a8b12003d185e6a52cc16585287e2ac9f353478
parentMore variable renaming. (diff)
downloadpenes-snac2-866050306a94f5484bc1bfb3dc20d8761f9bb161.tar.gz
penes-snac2-866050306a94f5484bc1bfb3dc20d8761f9bb161.tar.xz
penes-snac2-866050306a94f5484bc1bfb3dc20d8761f9bb161.zip
More variable renaming.
-rw-r--r--html.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/html.c b/html.c
index 09a078b..f860dc1 100644
--- a/html.c
+++ b/html.c
@@ -1557,7 +1557,7 @@ xs_str *build_mentions(snac *user, const xs_dict *msg)
1557} 1557}
1558 1558
1559 1559
1560xs_html *html_entry_controls(snac *snac, const char *actor, 1560xs_html *html_entry_controls(snac *user, const char *actor,
1561 const xs_dict *msg, const char *md5) 1561 const xs_dict *msg, const char *md5)
1562{ 1562{
1563 const char *id = xs_dict_get(msg, "id"); 1563 const char *id = xs_dict_get(msg, "id");
@@ -1566,7 +1566,7 @@ xs_html *html_entry_controls(snac *snac, const char *actor,
1566 xs *likes = object_likes(id); 1566 xs *likes = object_likes(id);
1567 xs *boosts = object_announces(id); 1567 xs *boosts = object_announces(id);
1568 1568
1569 xs *action = xs_fmt("%s/admin/action", snac->actor); 1569 xs *action = xs_fmt("%s/admin/action", user->actor);
1570 xs *redir = xs_fmt("%s_entry", md5); 1570 xs *redir = xs_fmt("%s_entry", md5);
1571 1571
1572 xs_html *form; 1572 xs_html *form;
@@ -1593,8 +1593,8 @@ xs_html *html_entry_controls(snac *snac, const char *actor,
1593 xs_html_attr("name", "redir"), 1593 xs_html_attr("name", "redir"),
1594 xs_html_attr("value", redir)))); 1594 xs_html_attr("value", redir))));
1595 1595
1596 if (!xs_startswith(id, snac->actor)) { 1596 if (!xs_startswith(id, user->actor)) {
1597 if (xs_list_in(likes, snac->md5) == -1) { 1597 if (xs_list_in(likes, user->md5) == -1) {
1598 /* not already liked; add button */ 1598 /* not already liked; add button */
1599 xs_html_add(form, 1599 xs_html_add(form,
1600 html_button("like", L("Like"), L("Say you like this post"))); 1600 html_button("like", L("Like"), L("Say you like this post")));
@@ -1606,7 +1606,7 @@ xs_html *html_entry_controls(snac *snac, const char *actor,
1606 } 1606 }
1607 } 1607 }
1608 else { 1608 else {
1609 if (is_pinned(snac, id)) 1609 if (is_pinned(user, id))
1610 xs_html_add(form, 1610 xs_html_add(form,
1611 html_button("unpin", L("Unpin"), L("Unpin this post from your timeline"))); 1611 html_button("unpin", L("Unpin"), L("Unpin this post from your timeline")));
1612 else 1612 else
@@ -1615,7 +1615,7 @@ xs_html *html_entry_controls(snac *snac, const char *actor,
1615 } 1615 }
1616 1616
1617 if (is_msg_public(msg)) { 1617 if (is_msg_public(msg)) {
1618 if (xs_list_in(boosts, snac->md5) == -1) { 1618 if (xs_list_in(boosts, user->md5) == -1) {
1619 /* not already boosted; add button */ 1619 /* not already boosted; add button */
1620 xs_html_add(form, 1620 xs_html_add(form,
1621 html_button("boost", L("Boost"), L("Announce this post to your followers"))); 1621 html_button("boost", L("Boost"), L("Announce this post to your followers")));
@@ -1627,16 +1627,16 @@ xs_html *html_entry_controls(snac *snac, const char *actor,
1627 } 1627 }
1628 } 1628 }
1629 1629
1630 if (is_bookmarked(snac, id)) 1630 if (is_bookmarked(user, id))
1631 xs_html_add(form, 1631 xs_html_add(form,
1632 html_button("unbookmark", L("Unbookmark"), L("Delete this post from your bookmarks"))); 1632 html_button("unbookmark", L("Unbookmark"), L("Delete this post from your bookmarks")));
1633 else 1633 else
1634 xs_html_add(form, 1634 xs_html_add(form,
1635 html_button("bookmark", L("Bookmark"), L("Add this post to your bookmarks"))); 1635 html_button("bookmark", L("Bookmark"), L("Add this post to your bookmarks")));
1636 1636
1637 if (strcmp(actor, snac->actor) != 0) { 1637 if (strcmp(actor, user->actor) != 0) {
1638 /* controls for other actors than this one */ 1638 /* controls for other actors than this one */
1639 if (following_check(snac, actor)) { 1639 if (following_check(user, actor)) {
1640 xs_html_add(form, 1640 xs_html_add(form,
1641 html_button("unfollow", L("Unfollow"), L("Stop following this user's activity"))); 1641 html_button("unfollow", L("Unfollow"), L("Stop following this user's activity")));
1642 } 1642 }
@@ -1646,7 +1646,7 @@ xs_html *html_entry_controls(snac *snac, const char *actor,
1646 } 1646 }
1647 1647
1648 if (!xs_is_null(group)) { 1648 if (!xs_is_null(group)) {
1649 if (following_check(snac, group)) { 1649 if (following_check(user, group)) {
1650 xs_html_add(form, 1650 xs_html_add(form,
1651 html_button("unfollow", L("Unfollow Group"), 1651 html_button("unfollow", L("Unfollow Group"),
1652 L("Stop following this group or channel"))); 1652 L("Stop following this group or channel")));
@@ -1672,7 +1672,7 @@ xs_html *html_entry_controls(snac *snac, const char *actor,
1672 1672
1673 const char *prev_src = xs_dict_get(msg, "sourceContent"); 1673 const char *prev_src = xs_dict_get(msg, "sourceContent");
1674 1674
1675 if (!xs_is_null(prev_src) && strcmp(actor, snac->actor) == 0) { /** edit **/ 1675 if (!xs_is_null(prev_src) && strcmp(actor, user->actor) == 0) { /** edit **/
1676 /* post can be edited */ 1676 /* post can be edited */
1677 xs *div_id = xs_fmt("%s_edit", md5); 1677 xs *div_id = xs_fmt("%s_edit", md5);
1678 xs *form_id = xs_fmt("%s_edit_form", md5); 1678 xs *form_id = xs_fmt("%s_edit_form", md5);
@@ -1699,26 +1699,26 @@ xs_html *html_entry_controls(snac *snac, const char *actor,
1699 1699
1700 xs_html_add(controls, xs_html_tag("div", 1700 xs_html_add(controls, xs_html_tag("div",
1701 xs_html_tag("p", NULL), 1701 xs_html_tag("p", NULL),
1702 html_note(snac, L("Edit..."), 1702 html_note(user, L("Edit..."),
1703 div_id, form_id, 1703 div_id, form_id,
1704 "", prev_src, 1704 "", prev_src,
1705 id, NULL, 1705 id, NULL,
1706 xs_dict_get(msg, "sensitive"), xs_dict_get(msg, "summary"), 1706 xs_dict_get(msg, "sensitive"), xs_dict_get(msg, "summary"),
1707 xs_stock(is_msg_public(msg) ? XSTYPE_FALSE : XSTYPE_TRUE), redir, 1707 xs_stock(is_msg_public(msg) ? XSTYPE_FALSE : XSTYPE_TRUE), redir,
1708 NULL, 0, att_files, att_alt_texts, is_draft(snac, id))), 1708 NULL, 0, att_files, att_alt_texts, is_draft(user, id))),
1709 xs_html_tag("p", NULL)); 1709 xs_html_tag("p", NULL));
1710 } 1710 }
1711 1711
1712 { /** reply **/ 1712 { /** reply **/
1713 /* the post textarea */ 1713 /* the post textarea */
1714 xs *ct = build_mentions(snac, msg); 1714 xs *ct = build_mentions(user, msg);
1715 xs *div_id = xs_fmt("%s_reply", md5); 1715 xs *div_id = xs_fmt("%s_reply", md5);
1716 xs *form_id = xs_fmt("%s_reply_form", md5); 1716 xs *form_id = xs_fmt("%s_reply_form", md5);
1717 xs *redir = xs_fmt("%s_entry", md5); 1717 xs *redir = xs_fmt("%s_entry", md5);
1718 1718
1719 xs_html_add(controls, xs_html_tag("div", 1719 xs_html_add(controls, xs_html_tag("div",
1720 xs_html_tag("p", NULL), 1720 xs_html_tag("p", NULL),
1721 html_note(snac, L("Reply..."), 1721 html_note(user, L("Reply..."),
1722 div_id, form_id, 1722 div_id, form_id,
1723 "", ct, 1723 "", ct,
1724 NULL, NULL, 1724 NULL, NULL,