diff options
| author | 2023-08-10 19:18:24 +0200 | |
|---|---|---|
| committer | 2023-08-10 19:18:24 +0200 | |
| commit | 4c6f1a79e408ea3016b12136b913c5fa10ac8b4a (patch) | |
| tree | 6646be4a03f4e04c5c188a03fe754b0a3c9fb720 | |
| parent | More strict retries. (diff) | |
| download | snac2-4c6f1a79e408ea3016b12136b913c5fa10ac8b4a.tar.gz snac2-4c6f1a79e408ea3016b12136b913c5fa10ac8b4a.tar.xz snac2-4c6f1a79e408ea3016b12136b913c5fa10ac8b4a.zip | |
Added web UI for limit/unlimit actions.
| -rw-r--r-- | html.c | 18 |
1 files changed, 17 insertions, 1 deletions
| @@ -1488,9 +1488,17 @@ xs_str *html_people_list(snac *snac, xs_str *os, xs_list *list, const char *head | |||
| 1488 | ); | 1488 | ); |
| 1489 | s = xs_str_cat(s, s1); | 1489 | s = xs_str_cat(s, s1); |
| 1490 | 1490 | ||
| 1491 | if (following_check(snac, actor_id)) | 1491 | if (following_check(snac, actor_id)) { |
| 1492 | s = html_button(s, "unfollow", L("Unfollow"), | 1492 | s = html_button(s, "unfollow", L("Unfollow"), |
| 1493 | L("Stop following this user's activity")); | 1493 | L("Stop following this user's activity")); |
| 1494 | |||
| 1495 | if (is_limited(snac, actor_id)) | ||
| 1496 | s = html_button(s, "unlimit", L("Unlimit"), | ||
| 1497 | L("Allow announces (boosts) from this user")); | ||
| 1498 | else | ||
| 1499 | s = html_button(s, "limit", L("Limit"), | ||
| 1500 | L("Block announces (boosts) from this user")); | ||
| 1501 | } | ||
| 1494 | else { | 1502 | else { |
| 1495 | s = html_button(s, "follow", L("Follow"), | 1503 | s = html_button(s, "follow", L("Follow"), |
| 1496 | L("Start following this user's activity")); | 1504 | L("Start following this user's activity")); |
| @@ -2169,6 +2177,14 @@ int html_post_handler(const xs_dict *req, const char *q_path, | |||
| 2169 | hide(&snac, id); | 2177 | hide(&snac, id); |
| 2170 | } | 2178 | } |
| 2171 | else | 2179 | else |
| 2180 | if (strcmp(action, L("Limit")) == 0) { /** **/ | ||
| 2181 | limit(&snac, actor); | ||
| 2182 | } | ||
| 2183 | else | ||
| 2184 | if (strcmp(action, L("Unlimit")) == 0) { /** **/ | ||
| 2185 | unlimit(&snac, actor); | ||
| 2186 | } | ||
| 2187 | else | ||
| 2172 | if (strcmp(action, L("Follow")) == 0) { /** **/ | 2188 | if (strcmp(action, L("Follow")) == 0) { /** **/ |
| 2173 | xs *msg = msg_follow(&snac, actor); | 2189 | xs *msg = msg_follow(&snac, actor); |
| 2174 | 2190 | ||