commit 4c6f1a7
default
·
2023-08-10 17:18:24 +0000 UTC
parent fff4ff4
Added web UI for limit/unlimit actions.
1 files changed,
+17,
-1
M
html.c
M
html.c
+17,
-1
1@@ -1488,9 +1488,17 @@ xs_str *html_people_list(snac *snac, xs_str *os, xs_list *list, const char *head
2 );
3 s = xs_str_cat(s, s1);
4
5- if (following_check(snac, actor_id))
6+ if (following_check(snac, actor_id)) {
7 s = html_button(s, "unfollow", L("Unfollow"),
8 L("Stop following this user's activity"));
9+
10+ if (is_limited(snac, actor_id))
11+ s = html_button(s, "unlimit", L("Unlimit"),
12+ L("Allow announces (boosts) from this user"));
13+ else
14+ s = html_button(s, "limit", L("Limit"),
15+ L("Block announces (boosts) from this user"));
16+ }
17 else {
18 s = html_button(s, "follow", L("Follow"),
19 L("Start following this user's activity"));
20@@ -2169,6 +2177,14 @@ int html_post_handler(const xs_dict *req, const char *q_path,
21 hide(&snac, id);
22 }
23 else
24+ if (strcmp(action, L("Limit")) == 0) { /** **/
25+ limit(&snac, actor);
26+ }
27+ else
28+ if (strcmp(action, L("Unlimit")) == 0) { /** **/
29+ unlimit(&snac, actor);
30+ }
31+ else
32 if (strcmp(action, L("Follow")) == 0) { /** **/
33 xs *msg = msg_follow(&snac, actor);
34