diff options
| author | 2023-07-04 14:07:33 +0200 | |
|---|---|---|
| committer | 2023-07-04 14:07:33 +0200 | |
| commit | 7db4de872d043593b63de09cea27bd350e3e5f58 (patch) | |
| tree | f0856a1414433d3ec5ef63485312d1b2ac669371 | |
| parent | Backport from xs. (diff) | |
| download | snac2-7db4de872d043593b63de09cea27bd350e3e5f58.tar.gz snac2-7db4de872d043593b63de09cea27bd350e3e5f58.tar.xz snac2-7db4de872d043593b63de09cea27bd350e3e5f58.zip | |
Also show unfollows in the notification area.
| -rw-r--r-- | activitypub.c | 2 | ||||
| -rw-r--r-- | 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, | |||
| 686 | enqueue_telegram(body, bot, chat_id); | 686 | enqueue_telegram(body, bot, chat_id); |
| 687 | 687 | ||
| 688 | /* finally, store it in the notification folder */ | 688 | /* finally, store it in the notification folder */ |
| 689 | if (strcmp(type, "Follow") == 0) | 689 | if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0) |
| 690 | objid = id; | 690 | objid = id; |
| 691 | 691 | ||
| 692 | notify_add(snac, type, utype, actor, objid != NULL ? objid : id); | 692 | notify_add(snac, type, utype, actor, objid != NULL ? objid : id); |
| @@ -1437,7 +1437,7 @@ xs_str *html_notifications(snac *snac) | |||
| 1437 | "<form autocomplete=\"off\" " | 1437 | "<form autocomplete=\"off\" " |
| 1438 | "method=\"post\" action=\"%s/admin/clear-notifications\" id=\"clear\">\n" | 1438 | "method=\"post\" action=\"%s/admin/clear-notifications\" id=\"clear\">\n" |
| 1439 | "<input type=\"submit\" class=\"snac-btn-like\" value=\"%s\">\n" | 1439 | "<input type=\"submit\" class=\"snac-btn-like\" value=\"%s\">\n" |
| 1440 | "</form><p>", snac->actor, L("Clear all")); | 1440 | "</form><p>\n", snac->actor, L("Clear all")); |
| 1441 | s = xs_str_cat(s, s1); | 1441 | s = xs_str_cat(s, s1); |
| 1442 | 1442 | ||
| 1443 | while (xs_list_iter(&p, &v)) { | 1443 | while (xs_list_iter(&p, &v)) { |
| @@ -1498,13 +1498,16 @@ xs_str *html_notifications(snac *snac) | |||
| 1498 | else | 1498 | else |
| 1499 | if (strcmp(type, "Update") == 0 && strcmp(utype, "Question") == 0) | 1499 | if (strcmp(type, "Update") == 0 && strcmp(utype, "Question") == 0) |
| 1500 | label = L("Finished poll"); | 1500 | label = L("Finished poll"); |
| 1501 | else | ||
| 1502 | if (strcmp(type, "Undo") == 0 && strcmp(utype, "Follow") == 0) | ||
| 1503 | label = L("Unfollow"); | ||
| 1501 | 1504 | ||
| 1502 | xs *s1 = xs_fmt("<div class=\"snac-post-with-desc\">\n" | 1505 | xs *s1 = xs_fmt("<div class=\"snac-post-with-desc\">\n" |
| 1503 | "<p><b>%s by <a href=\"%s\">%s</a></b>:</p>\n", | 1506 | "<p><b>%s by <a href=\"%s\">%s</a></b>:</p>\n", |
| 1504 | label, actor_id, a_name); | 1507 | label, actor_id, a_name); |
| 1505 | s = xs_str_cat(s, s1); | 1508 | s = xs_str_cat(s, s1); |
| 1506 | 1509 | ||
| 1507 | if (strcmp(type, "Follow") == 0) { | 1510 | if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0) { |
| 1508 | s = xs_str_cat(s, "<div class=\"snac-post\">\n"); | 1511 | s = xs_str_cat(s, "<div class=\"snac-post\">\n"); |
| 1509 | 1512 | ||
| 1510 | s = html_msg_icon(snac, s, obj); | 1513 | s = html_msg_icon(snac, s, obj); |