commit 1d37e33

default  ·  2025-02-05 09:14:42 +0000 UTC
parent 8f76c4d
Added a 'Context' link to each notification.
1 files changed,  +7, -1
M html.c
M html.c
+7, -1
 1@@ -3129,11 +3129,16 @@ xs_str *html_notifications(snac *user, int skip, int show)
 2         else
 3         if (obj != NULL) {
 4             xs *md5 = xs_md5_hex(id, strlen(id));
 5+            xs *ctxt = xs_fmt("%s/admin/p/%s#%s_entry", user->actor, md5, md5);
 6 
 7             xs_html *h = html_entry(user, obj, 0, 0, md5, 1);
 8 
 9             if (h != NULL) {
10                 xs_html_add(entry,
11+                    xs_html_tag("p",
12+                        xs_html_tag("a",
13+                            xs_html_attr("href", ctxt),
14+                            xs_html_text(L("Context")))),
15                     h);
16             }
17         }
18@@ -3540,7 +3545,8 @@ int html_get_handler(const xs_dict *req, const char *q_path,
19             const char *md5 = xs_list_get(l, -1);
20 
21             if (md5 && *md5 && timeline_here(&snac, md5)) {
22-                xs *list = xs_list_append(xs_list_new(), md5);
23+                xs *list0 = xs_list_append(xs_list_new(), md5);
24+                xs *list  = timeline_top_level(&snac, list0);
25 
26                 *body   = html_timeline(&snac, list, 0, 0, 0, 0, NULL, "/admin", 1, error);
27                 *b_size = strlen(*body);