commit 7db4de8
default
·
2023-07-04 12:07:33 +0000 UTC
parent 5b3c7d4
Also show unfollows in the notification area.
2 files changed,
+6,
-3
M
html.c
+1,
-1
1@@ -686,7 +686,7 @@ void notify(snac *snac, const char *type, const char *utype, const char *actor,
2 enqueue_telegram(body, bot, chat_id);
3
4 /* finally, store it in the notification folder */
5- if (strcmp(type, "Follow") == 0)
6+ if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0)
7 objid = id;
8
9 notify_add(snac, type, utype, actor, objid != NULL ? objid : id);
M
html.c
+5,
-2
1@@ -1437,7 +1437,7 @@ xs_str *html_notifications(snac *snac)
2 "<form autocomplete=\"off\" "
3 "method=\"post\" action=\"%s/admin/clear-notifications\" id=\"clear\">\n"
4 "<input type=\"submit\" class=\"snac-btn-like\" value=\"%s\">\n"
5- "</form><p>", snac->actor, L("Clear all"));
6+ "</form><p>\n", snac->actor, L("Clear all"));
7 s = xs_str_cat(s, s1);
8
9 while (xs_list_iter(&p, &v)) {
10@@ -1498,13 +1498,16 @@ xs_str *html_notifications(snac *snac)
11 else
12 if (strcmp(type, "Update") == 0 && strcmp(utype, "Question") == 0)
13 label = L("Finished poll");
14+ else
15+ if (strcmp(type, "Undo") == 0 && strcmp(utype, "Follow") == 0)
16+ label = L("Unfollow");
17
18 xs *s1 = xs_fmt("<div class=\"snac-post-with-desc\">\n"
19 "<p><b>%s by <a href=\"%s\">%s</a></b>:</p>\n",
20 label, actor_id, a_name);
21 s = xs_str_cat(s, s1);
22
23- if (strcmp(type, "Follow") == 0) {
24+ if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0) {
25 s = xs_str_cat(s, "<div class=\"snac-post\">\n");
26
27 s = html_msg_icon(snac, s, obj);