diff options
| author | 2025-01-25 21:45:14 +0100 | |
|---|---|---|
| committer | 2025-01-25 21:45:14 +0100 | |
| commit | 896a36837c8da070d85abe92d62d12c4009fca1c (patch) | |
| tree | 23c533140fe19fe374e2780bc15dd0f6481c7d52 | |
| parent | Bumped version. (diff) | |
| download | penes-snac2-896a36837c8da070d85abe92d62d12c4009fca1c.tar.gz penes-snac2-896a36837c8da070d85abe92d62d12c4009fca1c.tar.xz penes-snac2-896a36837c8da070d85abe92d62d12c4009fca1c.zip | |
Another tweak to fix repeated notifications.
| -rw-r--r-- | html.c | 9 |
1 files changed, 9 insertions, 0 deletions
| @@ -2967,6 +2967,9 @@ 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_set rep; | ||
| 2971 | xs_set_init(&rep); | ||
| 2972 | |||
| 2970 | /* dict to store previous notification labels */ | 2973 | /* dict to store previous notification labels */ |
| 2971 | xs *admiration_labels = xs_dict_new(); | 2974 | xs *admiration_labels = xs_dict_new(); |
| 2972 | 2975 | ||
| @@ -2983,6 +2986,7 @@ xs_str *html_notifications(snac *user, int skip, int show) | |||
| 2983 | const char *utype = xs_dict_get(noti, "utype"); | 2986 | const char *utype = xs_dict_get(noti, "utype"); |
| 2984 | const char *id = xs_dict_get(noti, "objid"); | 2987 | const char *id = xs_dict_get(noti, "objid"); |
| 2985 | const char *date = xs_dict_get(noti, "date"); | 2988 | const char *date = xs_dict_get(noti, "date"); |
| 2989 | const char *id2 = xs_dict_get_path(noti, "msg.id"); | ||
| 2986 | xs *wrk = NULL; | 2990 | xs *wrk = NULL; |
| 2987 | 2991 | ||
| 2988 | if (xs_is_null(id)) | 2992 | if (xs_is_null(id)) |
| @@ -2991,6 +2995,9 @@ xs_str *html_notifications(snac *user, int skip, int show) | |||
| 2991 | if (is_hidden(user, id)) | 2995 | if (is_hidden(user, id)) |
| 2992 | continue; | 2996 | continue; |
| 2993 | 2997 | ||
| 2998 | if (xs_is_string(id2) && xs_set_add(&rep, id2) != 1) | ||
| 2999 | continue; | ||
| 3000 | |||
| 2994 | object_get(id, &obj); | 3001 | object_get(id, &obj); |
| 2995 | 3002 | ||
| 2996 | const char *msg_id = NULL; | 3003 | const char *msg_id = NULL; |
| @@ -3158,6 +3165,8 @@ xs_str *html_notifications(snac *user, int skip, int show) | |||
| 3158 | xs_html_text(L("More..."))))); | 3165 | xs_html_text(L("More..."))))); |
| 3159 | } | 3166 | } |
| 3160 | 3167 | ||
| 3168 | xs_set_free(&rep); | ||
| 3169 | |||
| 3161 | xs_html_add(body, | 3170 | xs_html_add(body, |
| 3162 | html_footer()); | 3171 | html_footer()); |
| 3163 | 3172 | ||