diff options
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 29 |
1 files changed, 23 insertions, 6 deletions
| @@ -2470,10 +2470,9 @@ xs_html *html_people_list(snac *snac, xs_list *list, char *header, char *t, cons | |||
| 2470 | xs_html_tag("summary", | 2470 | xs_html_tag("summary", |
| 2471 | xs_html_text("...")))); | 2471 | xs_html_text("...")))); |
| 2472 | 2472 | ||
| 2473 | xs_list *p = list; | ||
| 2474 | const char *actor_id; | 2473 | const char *actor_id; |
| 2475 | 2474 | ||
| 2476 | while (xs_list_iter(&p, &actor_id)) { | 2475 | xs_list_foreach(list, actor_id) { |
| 2477 | xs *md5 = xs_md5_hex(actor_id, strlen(actor_id)); | 2476 | xs *md5 = xs_md5_hex(actor_id, strlen(actor_id)); |
| 2478 | xs *actor = NULL; | 2477 | xs *actor = NULL; |
| 2479 | 2478 | ||
| @@ -2542,6 +2541,14 @@ xs_html *html_people_list(snac *snac, xs_list *list, char *header, char *t, cons | |||
| 2542 | html_button("limit", L("Limit"), | 2541 | html_button("limit", L("Limit"), |
| 2543 | L("Block announces (boosts) from this user"))); | 2542 | L("Block announces (boosts) from this user"))); |
| 2544 | } | 2543 | } |
| 2544 | if (pending_check(snac, actor_id)) { | ||
| 2545 | xs_html_add(form, | ||
| 2546 | html_button("approve", L("Approve"), | ||
| 2547 | L("Approve this follow request"))); | ||
| 2548 | |||
| 2549 | xs_html_add(form, | ||
| 2550 | html_button("discard", L("Discard"), L("Discard this follow request"))); | ||
| 2551 | } | ||
| 2545 | else { | 2552 | else { |
| 2546 | xs_html_add(form, | 2553 | xs_html_add(form, |
| 2547 | html_button("follow", L("Follow"), | 2554 | html_button("follow", L("Follow"), |
| @@ -2596,13 +2603,23 @@ xs_str *html_people(snac *user) | |||
| 2596 | xs *wing = following_list(user); | 2603 | xs *wing = following_list(user); |
| 2597 | xs *wers = follower_list(user); | 2604 | xs *wers = follower_list(user); |
| 2598 | 2605 | ||
| 2606 | xs_html *lists = xs_html_tag("div", | ||
| 2607 | xs_html_attr("class", "snac-posts")); | ||
| 2608 | |||
| 2609 | if (xs_is_true(xs_dict_get(user->config, "approve_followers"))) { | ||
| 2610 | xs *pending = pending_list(user); | ||
| 2611 | xs_html_add(lists, | ||
| 2612 | html_people_list(user, pending, L("Pending follow confirmations"), "p", proxy)); | ||
| 2613 | } | ||
| 2614 | |||
| 2615 | xs_html_add(lists, | ||
| 2616 | html_people_list(user, wing, L("People you follow"), "i", proxy), | ||
| 2617 | html_people_list(user, wers, L("People that follow you"), "e", proxy)); | ||
| 2618 | |||
| 2599 | xs_html *html = xs_html_tag("html", | 2619 | xs_html *html = xs_html_tag("html", |
| 2600 | html_user_head(user, NULL, NULL), | 2620 | html_user_head(user, NULL, NULL), |
| 2601 | xs_html_add(html_user_body(user, 0), | 2621 | xs_html_add(html_user_body(user, 0), |
| 2602 | xs_html_tag("div", | 2622 | lists, |
| 2603 | xs_html_attr("class", "snac-posts"), | ||
| 2604 | html_people_list(user, wing, L("People you follow"), "i", proxy), | ||
| 2605 | html_people_list(user, wers, L("People that follow you"), "e", proxy)), | ||
| 2606 | html_footer())); | 2623 | html_footer())); |
| 2607 | 2624 | ||
| 2608 | return xs_html_render_s(html, "<!DOCTYPE html>\n"); | 2625 | return xs_html_render_s(html, "<!DOCTYPE html>\n"); |