From 7db4de872d043593b63de09cea27bd350e3e5f58 Mon Sep 17 00:00:00 2001 From: default Date: Tue, 4 Jul 2023 14:07:33 +0200 Subject: [PATCH] Also show unfollows in the notification area. --- activitypub.c | 2 +- html.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/activitypub.c b/activitypub.c index ce72f3f..de7de6a 100644 --- a/activitypub.c +++ b/activitypub.c @@ -686,7 +686,7 @@ void notify(snac *snac, const char *type, const char *utype, const char *actor, enqueue_telegram(body, bot, chat_id); /* finally, store it in the notification folder */ - if (strcmp(type, "Follow") == 0) + if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0) objid = id; notify_add(snac, type, utype, actor, objid != NULL ? objid : id); diff --git a/html.c b/html.c index 425df4b..ce7f511 100644 --- a/html.c +++ b/html.c @@ -1437,7 +1437,7 @@ xs_str *html_notifications(snac *snac) "
\n" "\n" - "

", snac->actor, L("Clear all")); + "

\n", snac->actor, L("Clear all")); s = xs_str_cat(s, s1); while (xs_list_iter(&p, &v)) { @@ -1498,13 +1498,16 @@ xs_str *html_notifications(snac *snac) else if (strcmp(type, "Update") == 0 && strcmp(utype, "Question") == 0) label = L("Finished poll"); + else + if (strcmp(type, "Undo") == 0 && strcmp(utype, "Follow") == 0) + label = L("Unfollow"); xs *s1 = xs_fmt("

\n" "

%s by %s:

\n", label, actor_id, a_name); s = xs_str_cat(s, s1); - if (strcmp(type, "Follow") == 0) { + if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0) { s = xs_str_cat(s, "
\n"); s = html_msg_icon(snac, s, obj);