summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--html.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/html.c b/html.c
index a15bd06..3fd1e4b 100644
--- a/html.c
+++ b/html.c
@@ -2967,9 +2967,12 @@ xs_str *html_notifications(snac *user, int skip, int show)
2967 xs_html_attr("class", "snac-posts")); 2967 xs_html_attr("class", "snac-posts"));
2968 xs_html_add(body, posts); 2968 xs_html_add(body, posts);
2969 2969
2970 xs_list *p = n_list; 2970 xs_set rep;
2971 xs_set_init(&rep);
2972
2971 const xs_str *v; 2973 const xs_str *v;
2972 while (xs_list_iter(&p, &v)) { 2974
2975 xs_list_foreach(n_list, v) {
2973 xs *noti = notify_get(user, v); 2976 xs *noti = notify_get(user, v);
2974 2977
2975 if (noti == NULL) 2978 if (noti == NULL)
@@ -2990,6 +2993,11 @@ xs_str *html_notifications(snac *user, int skip, int show)
2990 2993
2991 object_get(id, &obj); 2994 object_get(id, &obj);
2992 2995
2996 const char *msg_id = NULL;
2997
2998 if (xs_is_dict(obj) && (msg_id = xs_dict_get(obj, "id")) && xs_set_add(&rep, msg_id) != 1)
2999 continue;
3000
2993 const char *actor_id = xs_dict_get(noti, "actor"); 3001 const char *actor_id = xs_dict_get(noti, "actor");
2994 xs *actor = NULL; 3002 xs *actor = NULL;
2995 3003
@@ -3103,6 +3111,8 @@ xs_str *html_notifications(snac *user, int skip, int show)
3103 } 3111 }
3104 } 3112 }
3105 3113
3114 xs_set_free(&rep);
3115
3106 if (noti_new == NULL && noti_seen == NULL) 3116 if (noti_new == NULL && noti_seen == NULL)
3107 xs_html_add(body, 3117 xs_html_add(body,
3108 xs_html_tag("h2", 3118 xs_html_tag("h2",