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 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)
287 int n_len = xs_list_len(n_list); 287 int n_len = xs_list_len(n_list);
288 xs *n_str = NULL; 288 xs *n_str = NULL;
289 289
290 /* show the notification number, if there are any */ 290 /* show the number of new notifications, if there are any */
291 if (n_len) 291 if (n_len)
292 n_str = xs_fmt("<sup style=\"background-color: red; " 292 n_str = xs_fmt("<sup style=\"background-color: red; "
293 "color: white;\"> %d </sup> ", n_len); 293 "color: white;\"> %d </sup> ", n_len);
@@ -1215,6 +1215,14 @@ xs_str *html_notifications(snac *snac)
1215 if (is_hidden(snac, id)) 1215 if (is_hidden(snac, id))
1216 continue; 1216 continue;
1217 1217
1218 const char *actor_id = xs_dict_get(noti, "actor");
1219 xs *actor = NULL;
1220
1221 if (!valid_status(object_get(actor_id, &actor)))
1222 continue;
1223
1224 xs *a_name = actor_name(actor);
1225
1218 if (strcmp(v, n_time) > 0) { 1226 if (strcmp(v, n_time) > 0) {
1219 /* unseen notification */ 1227 /* unseen notification */
1220 if (stage == NHDR_NONE) { 1228 if (stage == NHDR_NONE) {
@@ -1236,7 +1244,8 @@ xs_str *html_notifications(snac *snac)
1236 1244
1237 s = xs_str_cat(s, "<div>\n"); 1245 s = xs_str_cat(s, "<div>\n");
1238 1246
1239 xs *s1 = xs_fmt("<p><b>%s</b>:</p>\n", strcmp(type, "Create") == 0 ? "Mention" : type); 1247 xs *s1 = xs_fmt("<p>%s by <a href=\"%s\">%s</a>:</p>\n",
1248 strcmp(type, "Create") == 0 ? "Mention" : type, actor_id, a_name);
1240 s = xs_str_cat(s, s1); 1249 s = xs_str_cat(s, s1);
1241 1250
1242 if (strcmp(type, "Follow") == 0) { 1251 if (strcmp(type, "Follow") == 0) {
@@ -1248,6 +1257,7 @@ xs_str *html_notifications(snac *snac)
1248 } 1257 }
1249 else { 1258 else {
1250 xs *md5 = xs_md5_hex(id, strlen(id)); 1259 xs *md5 = xs_md5_hex(id, strlen(id));
1260
1251 s = html_entry(snac, s, obj, 0, 0, md5, 1); 1261 s = html_entry(snac, s, obj, 0, 0, md5, 1);
1252 } 1262 }
1253 1263