summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2024-01-31 08:18:50 +0100
committerGravatar default2024-01-31 08:18:50 +0100
commit5563a41ed041ea1de6574b37bc5efe10c732ab36 (patch)
tree7bb5238ad046bd0a24a20d8aa8ec9c32955cd48e
parentMinor tweak to host-meta. (diff)
downloadsnac2-5563a41ed041ea1de6574b37bc5efe10c732ab36.tar.gz
snac2-5563a41ed041ea1de6574b37bc5efe10c732ab36.tar.xz
snac2-5563a41ed041ea1de6574b37bc5efe10c732ab36.zip
Added the date to each notification.
-rw-r--r--html.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/html.c b/html.c
index de2c60e..86ec3c6 100644
--- a/html.c
+++ b/html.c
@@ -2163,6 +2163,7 @@ xs_str *html_notifications(snac *user)
2163 char *type = xs_dict_get(noti, "type"); 2163 char *type = xs_dict_get(noti, "type");
2164 char *utype = xs_dict_get(noti, "utype"); 2164 char *utype = xs_dict_get(noti, "utype");
2165 char *id = xs_dict_get(noti, "objid"); 2165 char *id = xs_dict_get(noti, "objid");
2166 char *date = xs_dict_get(noti, "date");
2166 2167
2167 if (xs_is_null(id) || !valid_status(object_get(id, &obj))) 2168 if (xs_is_null(id) || !valid_status(object_get(id, &obj)))
2168 continue; 2169 continue;
@@ -2188,6 +2189,8 @@ xs_str *html_notifications(snac *user)
2188 if (strcmp(type, "Undo") == 0 && strcmp(utype, "Follow") == 0) 2189 if (strcmp(type, "Undo") == 0 && strcmp(utype, "Follow") == 0)
2189 label = L("Unfollow"); 2190 label = L("Unfollow");
2190 2191
2192 xs *s_date = xs_crop_i(xs_dup(date), 0, 10);
2193
2191 xs_html *entry = xs_html_tag("div", 2194 xs_html *entry = xs_html_tag("div",
2192 xs_html_attr("class", "snac-post-with-desc"), 2195 xs_html_attr("class", "snac-post-with-desc"),
2193 xs_html_tag("p", 2196 xs_html_tag("p",
@@ -2196,7 +2199,12 @@ xs_str *html_notifications(snac *user)
2196 xs_html_text(" by "), 2199 xs_html_text(" by "),
2197 xs_html_tag("a", 2200 xs_html_tag("a",
2198 xs_html_attr("href", actor_id), 2201 xs_html_attr("href", actor_id),
2199 xs_html_raw(a_name))))); /* a_name is already sanitized */ 2202 xs_html_raw(a_name))), /* a_name is already sanitized */
2203 xs_html_text(" "),
2204 xs_html_tag("time",
2205 xs_html_attr("class", "dt-published snac-pubdate"),
2206 xs_html_attr("title", date),
2207 xs_html_text(s_date))));
2200 2208
2201 if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0) { 2209 if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0) {
2202 xs_html_add(entry, 2210 xs_html_add(entry,