commit f80614b
grunfink
·
2026-09-10 14:00:33 +0000 UTC
parent 7419724
Show notifications from cool users.
2 files changed,
+20,
-3
M
html.c
+1,
-1
1@@ -1227,7 +1227,7 @@ void notify(snac *snac, const char *type, const char *utype, const char *actor,
2 /* only notify of notes specifically for us */
3 xs *rcpts = recipient_list(snac, msg, 0);
4
5- if (xs_list_in(rcpts, snac->actor) == -1)
6+ if (xs_list_in(rcpts, snac->actor) == -1 && !cool(snac, actor, OP_CHECK))
7 return;
8
9 /* discard votes */
M
html.c
+19,
-2
1@@ -4476,8 +4476,25 @@ xs_str *html_notifications(snac *user, int skip, int show)
2 xs *label_sanitized = sanitize(type);
3 const char *label = label_sanitized;
4
5- if (strcmp(type, "Create") == 0)
6- label = L("Mention");
7+ if (strcmp(type, "Create") == 0) {
8+ label = L("Post");
9+
10+ /* check if it's a mention */
11+ const xs_list *l = xs_dict_get_def(obj, "tag", xs_stock(XSTYPE_LIST));
12+ const xs_dict *d;
13+
14+ xs_list_foreach(l, d) {
15+ if (xs_is_dict(d)) {
16+ const char *type = xs_dict_get_def(d, "type", "");
17+ const char *href = xs_dict_get_def(d, "href", "");
18+
19+ if (strcmp(type, "Mention") == 0 && strcmp(href, user->actor) == 0) {
20+ label = L("Mention");
21+ break;
22+ }
23+ }
24+ }
25+ }
26 else
27 if (strcmp(type, "Update") == 0 && strcmp(utype, "Question") == 0)
28 label = L("Finished poll");