summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar grunfink2025-11-20 10:22:53 +0100
committerGravatar grunfink2025-11-20 10:22:53 +0100
commitd4137522487235180528281ee64b7c5963f63ebe (patch)
tree5540e264f29634edf49fab637cc372a5036b43d5 /html.c
parentUpdated RELEASE_NOTES. (diff)
downloadsnac2-d4137522487235180528281ee64b7c5963f63ebe.tar.gz
snac2-d4137522487235180528281ee64b7c5963f63ebe.tar.xz
snac2-d4137522487235180528281ee64b7c5963f63ebe.zip
Added a Follow/Unfollow button next to a new follow notification.
Diffstat (limited to 'html.c')
-rw-r--r--html.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/html.c b/html.c
index 18038ff..df5b508 100644
--- a/html.c
+++ b/html.c
@@ -3746,7 +3746,7 @@ xs_str *html_notifications(snac *user, int skip, int show)
3746 xs_html_attr("class", "snac-post-with-desc"), 3746 xs_html_attr("class", "snac-post-with-desc"),
3747 html_label); 3747 html_label);
3748 3748
3749 if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0 || strcmp(type, "Block") == 0) { 3749 if (strcmp(type, "Block") == 0) {
3750 if (actor) 3750 if (actor)
3751 xs_html_add(entry, 3751 xs_html_add(entry,
3752 xs_html_tag("div", 3752 xs_html_tag("div",
@@ -3754,6 +3754,32 @@ xs_str *html_notifications(snac *user, int skip, int show)
3754 html_actor_icon(user, actor, NULL, NULL, NULL, -1, 0, proxy, NULL, NULL))); 3754 html_actor_icon(user, actor, NULL, NULL, NULL, -1, 0, proxy, NULL, NULL)));
3755 } 3755 }
3756 else 3756 else
3757 if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0) {
3758 if (actor) {
3759 xs *action = xs_fmt("%s/admin/action", user->actor);
3760 xs_html *button = NULL;
3761
3762 if (following_check(user, actor_id))
3763 button = html_button("unfollow", L("Unfollow"), L("Stop following this user's activity"));
3764 else
3765 button = html_button("follow", L("Follow"), L("Start following this user's activity"));
3766
3767 xs_html_add(entry,
3768 xs_html_tag("div",
3769 xs_html_attr("class", "snac-post"),
3770 html_actor_icon(user, actor, NULL, NULL, NULL, -1, 0, proxy, NULL, NULL),
3771 xs_html_tag("form",
3772 xs_html_attr("method", "post"),
3773 xs_html_attr("action", action),
3774 xs_html_sctag("input",
3775 xs_html_attr("type", "hidden"),
3776 xs_html_attr("name", "actor"),
3777 xs_html_attr("value", actor_id)),
3778 button,
3779 xs_html_sctag("br", NULL))));
3780 }
3781 }
3782 else
3757 if (strcmp(type, "Move") == 0) { 3783 if (strcmp(type, "Move") == 0) {
3758 const xs_dict *o_msg = xs_dict_get(noti, "msg"); 3784 const xs_dict *o_msg = xs_dict_get(noti, "msg");
3759 const char *target; 3785 const char *target;