From a64a25a551112d874c36f4fe35e9c38b5f453426 Mon Sep 17 00:00:00 2001 From: default Date: Fri, 14 Apr 2023 13:32:37 +0200 Subject: [PATCH] More notification web tweaks. --- html.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/html.c b/html.c index 29b18a3..4c9ca31 100644 --- a/html.c +++ b/html.c @@ -287,7 +287,7 @@ d_char *html_user_header(snac *snac, d_char *s, int local) int n_len = xs_list_len(n_list); xs *n_str = NULL; - /* show the notification number, if there are any */ + /* show the number of new notifications, if there are any */ if (n_len) n_str = xs_fmt(" %d ", n_len); @@ -1215,6 +1215,14 @@ xs_str *html_notifications(snac *snac) if (is_hidden(snac, id)) continue; + const char *actor_id = xs_dict_get(noti, "actor"); + xs *actor = NULL; + + if (!valid_status(object_get(actor_id, &actor))) + continue; + + xs *a_name = actor_name(actor); + if (strcmp(v, n_time) > 0) { /* unseen notification */ if (stage == NHDR_NONE) { @@ -1236,7 +1244,8 @@ xs_str *html_notifications(snac *snac) s = xs_str_cat(s, "
\n"); - xs *s1 = xs_fmt("

%s:

\n", strcmp(type, "Create") == 0 ? "Mention" : type); + xs *s1 = xs_fmt("

%s by %s:

\n", + strcmp(type, "Create") == 0 ? "Mention" : type, actor_id, a_name); s = xs_str_cat(s, s1); if (strcmp(type, "Follow") == 0) { @@ -1248,6 +1257,7 @@ xs_str *html_notifications(snac *snac) } else { xs *md5 = xs_md5_hex(id, strlen(id)); + s = html_entry(snac, s, obj, 0, 0, md5, 1); }