commit 8660503

default  ·  2025-02-14 08:29:37 +0000 UTC
parent bf9d8cb
More variable renaming.
1 files changed,  +15, -15
M html.c
M html.c
+15, -15
  1@@ -1557,7 +1557,7 @@ xs_str *build_mentions(snac *user, const xs_dict *msg)
  2 }
  3 
  4 
  5-xs_html *html_entry_controls(snac *snac, const char *actor,
  6+xs_html *html_entry_controls(snac *user, const char *actor,
  7                             const xs_dict *msg, const char *md5)
  8 {
  9     const char *id    = xs_dict_get(msg, "id");
 10@@ -1566,7 +1566,7 @@ xs_html *html_entry_controls(snac *snac, const char *actor,
 11     xs *likes   = object_likes(id);
 12     xs *boosts  = object_announces(id);
 13 
 14-    xs *action = xs_fmt("%s/admin/action", snac->actor);
 15+    xs *action = xs_fmt("%s/admin/action", user->actor);
 16     xs *redir  = xs_fmt("%s_entry", md5);
 17 
 18     xs_html *form;
 19@@ -1593,8 +1593,8 @@ xs_html *html_entry_controls(snac *snac, const char *actor,
 20                 xs_html_attr("name",     "redir"),
 21                 xs_html_attr("value",    redir))));
 22 
 23-    if (!xs_startswith(id, snac->actor)) {
 24-        if (xs_list_in(likes, snac->md5) == -1) {
 25+    if (!xs_startswith(id, user->actor)) {
 26+        if (xs_list_in(likes, user->md5) == -1) {
 27             /* not already liked; add button */
 28             xs_html_add(form,
 29                 html_button("like", L("Like"), L("Say you like this post")));
 30@@ -1606,7 +1606,7 @@ xs_html *html_entry_controls(snac *snac, const char *actor,
 31         }
 32     }
 33     else {
 34-        if (is_pinned(snac, id))
 35+        if (is_pinned(user, id))
 36             xs_html_add(form,
 37                 html_button("unpin", L("Unpin"), L("Unpin this post from your timeline")));
 38         else
 39@@ -1615,7 +1615,7 @@ xs_html *html_entry_controls(snac *snac, const char *actor,
 40     }
 41 
 42     if (is_msg_public(msg)) {
 43-        if (xs_list_in(boosts, snac->md5) == -1) {
 44+        if (xs_list_in(boosts, user->md5) == -1) {
 45             /* not already boosted; add button */
 46             xs_html_add(form,
 47                 html_button("boost", L("Boost"), L("Announce this post to your followers")));
 48@@ -1627,16 +1627,16 @@ xs_html *html_entry_controls(snac *snac, const char *actor,
 49         }
 50     }
 51 
 52-    if (is_bookmarked(snac, id))
 53+    if (is_bookmarked(user, id))
 54             xs_html_add(form,
 55                 html_button("unbookmark", L("Unbookmark"), L("Delete this post from your bookmarks")));
 56         else
 57             xs_html_add(form,
 58                 html_button("bookmark", L("Bookmark"), L("Add this post to your bookmarks")));
 59 
 60-    if (strcmp(actor, snac->actor) != 0) {
 61+    if (strcmp(actor, user->actor) != 0) {
 62         /* controls for other actors than this one */
 63-        if (following_check(snac, actor)) {
 64+        if (following_check(user, actor)) {
 65             xs_html_add(form,
 66                 html_button("unfollow", L("Unfollow"), L("Stop following this user's activity")));
 67         }
 68@@ -1646,7 +1646,7 @@ xs_html *html_entry_controls(snac *snac, const char *actor,
 69         }
 70 
 71         if (!xs_is_null(group)) {
 72-            if (following_check(snac, group)) {
 73+            if (following_check(user, group)) {
 74                 xs_html_add(form,
 75                     html_button("unfollow", L("Unfollow Group"),
 76                         L("Stop following this group or channel")));
 77@@ -1672,7 +1672,7 @@ xs_html *html_entry_controls(snac *snac, const char *actor,
 78 
 79     const char *prev_src = xs_dict_get(msg, "sourceContent");
 80 
 81-    if (!xs_is_null(prev_src) && strcmp(actor, snac->actor) == 0) { /** edit **/
 82+    if (!xs_is_null(prev_src) && strcmp(actor, user->actor) == 0) { /** edit **/
 83         /* post can be edited */
 84         xs *div_id  = xs_fmt("%s_edit", md5);
 85         xs *form_id = xs_fmt("%s_edit_form", md5);
 86@@ -1699,26 +1699,26 @@ xs_html *html_entry_controls(snac *snac, const char *actor,
 87 
 88         xs_html_add(controls, xs_html_tag("div",
 89             xs_html_tag("p", NULL),
 90-            html_note(snac, L("Edit..."),
 91+            html_note(user, L("Edit..."),
 92                 div_id, form_id,
 93                 "", prev_src,
 94                 id, NULL,
 95                 xs_dict_get(msg, "sensitive"), xs_dict_get(msg, "summary"),
 96                 xs_stock(is_msg_public(msg) ? XSTYPE_FALSE : XSTYPE_TRUE), redir,
 97-                NULL, 0, att_files, att_alt_texts, is_draft(snac, id))),
 98+                NULL, 0, att_files, att_alt_texts, is_draft(user, id))),
 99             xs_html_tag("p", NULL));
100     }
101 
102     { /** reply **/
103         /* the post textarea */
104-        xs *ct      = build_mentions(snac, msg);
105+        xs *ct      = build_mentions(user, msg);
106         xs *div_id  = xs_fmt("%s_reply", md5);
107         xs *form_id = xs_fmt("%s_reply_form", md5);
108         xs *redir   = xs_fmt("%s_entry", md5);
109 
110         xs_html_add(controls, xs_html_tag("div",
111             xs_html_tag("p", NULL),
112-            html_note(snac, L("Reply..."),
113+            html_note(user, L("Reply..."),
114                 div_id, form_id,
115                 "", ct,
116                 NULL, NULL,