summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar shtrophic2025-01-24 20:38:26 +0100
committerGravatar shtrophic2025-01-24 20:38:26 +0100
commit85be7f36e12507cff7607df22ca14f8bfc00f6e2 (patch)
treee41bedab3e3b011c16d2ea6180926470cc8586aa /html.c
parentfix memory leak (diff)
parentVersion 2.69 RELEASED. (diff)
downloadpenes-snac2-85be7f36e12507cff7607df22ca14f8bfc00f6e2.tar.gz
penes-snac2-85be7f36e12507cff7607df22ca14f8bfc00f6e2.tar.xz
penes-snac2-85be7f36e12507cff7607df22ca14f8bfc00f6e2.zip
Merge remote-tracking branch 'upstream/master' into curl-smtp
Diffstat (limited to 'html.c')
-rw-r--r--html.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/html.c b/html.c
index 2a02d18..3fd1e4b 100644
--- a/html.c
+++ b/html.c
@@ -1855,13 +1855,15 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
1855 } 1855 }
1856 } 1856 }
1857 } 1857 }
1858 else
1859 if (strcmp(type, "Note") == 0) {
1860 if (level == 0) {
1861 /* is the parent not here? */
1862 const char *parent = get_in_reply_to(msg);
1863 1858
1864 if (user && !xs_is_null(parent) && *parent && !timeline_here(user, parent)) { 1859 if (user && strcmp(type, "Note") == 0) {
1860 /* is the parent not here? */
1861 const char *parent = get_in_reply_to(msg);
1862
1863 if (!xs_is_null(parent) && *parent) {
1864 xs *md5 = xs_md5_hex(parent, strlen(parent));
1865
1866 if (!timeline_here(user, md5)) {
1865 xs_html_add(post_header, 1867 xs_html_add(post_header,
1866 xs_html_tag("div", 1868 xs_html_tag("div",
1867 xs_html_attr("class", "snac-origin"), 1869 xs_html_attr("class", "snac-origin"),
@@ -2965,9 +2967,12 @@ xs_str *html_notifications(snac *user, int skip, int show)
2965 xs_html_attr("class", "snac-posts")); 2967 xs_html_attr("class", "snac-posts"));
2966 xs_html_add(body, posts); 2968 xs_html_add(body, posts);
2967 2969
2968 xs_list *p = n_list; 2970 xs_set rep;
2971 xs_set_init(&rep);
2972
2969 const xs_str *v; 2973 const xs_str *v;
2970 while (xs_list_iter(&p, &v)) { 2974
2975 xs_list_foreach(n_list, v) {
2971 xs *noti = notify_get(user, v); 2976 xs *noti = notify_get(user, v);
2972 2977
2973 if (noti == NULL) 2978 if (noti == NULL)
@@ -2988,6 +2993,11 @@ xs_str *html_notifications(snac *user, int skip, int show)
2988 2993
2989 object_get(id, &obj); 2994 object_get(id, &obj);
2990 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
2991 const char *actor_id = xs_dict_get(noti, "actor"); 3001 const char *actor_id = xs_dict_get(noti, "actor");
2992 xs *actor = NULL; 3002 xs *actor = NULL;
2993 3003
@@ -3101,6 +3111,8 @@ xs_str *html_notifications(snac *user, int skip, int show)
3101 } 3111 }
3102 } 3112 }
3103 3113
3114 xs_set_free(&rep);
3115
3104 if (noti_new == NULL && noti_seen == NULL) 3116 if (noti_new == NULL && noti_seen == NULL)
3105 xs_html_add(body, 3117 xs_html_add(body,
3106 xs_html_tag("h2", 3118 xs_html_tag("h2",