aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2025-01-25 21:45:14 +0100
committerdefault <nobody@localhost>2025-01-25 21:45:14 +0100
commit896a36837c8da070d85abe92d62d12c4009fca1c (patch)
tree23c533140fe19fe374e2780bc15dd0f6481c7d52
parent71537bdaf8fa3e752b7178efdf53e5c1c1402973 (diff)
Another tweak to fix repeated notifications.
-rw-r--r--html.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/html.c b/html.c
index e1f21bb..31d8d97 100644
--- a/html.c
+++ b/html.c
@@ -2967,6 +2967,9 @@ xs_str *html_notifications(snac *user, int skip, int show)
xs_html_attr("class", "snac-posts"));
xs_html_add(body, posts);
+ xs_set rep;
+ xs_set_init(&rep);
+
/* dict to store previous notification labels */
xs *admiration_labels = xs_dict_new();
@@ -2983,6 +2986,7 @@ xs_str *html_notifications(snac *user, int skip, int show)
const char *utype = xs_dict_get(noti, "utype");
const char *id = xs_dict_get(noti, "objid");
const char *date = xs_dict_get(noti, "date");
+ const char *id2 = xs_dict_get_path(noti, "msg.id");
xs *wrk = NULL;
if (xs_is_null(id))
@@ -2991,6 +2995,9 @@ xs_str *html_notifications(snac *user, int skip, int show)
if (is_hidden(user, id))
continue;
+ if (xs_is_string(id2) && xs_set_add(&rep, id2) != 1)
+ continue;
+
object_get(id, &obj);
const char *msg_id = NULL;
@@ -3158,6 +3165,8 @@ xs_str *html_notifications(snac *user, int skip, int show)
xs_html_text(L("More...")))));
}
+ xs_set_free(&rep);
+
xs_html_add(body,
html_footer());