summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
Diffstat (limited to 'html.c')
-rw-r--r--html.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/html.c b/html.c
index a54c782..c9cf9e3 100644
--- a/html.c
+++ b/html.c
@@ -1199,6 +1199,12 @@ xs_str *html_notifications(snac *snac)
1199 1199
1200 s = html_user_header(snac, s, 0); 1200 s = html_user_header(snac, s, 0);
1201 1201
1202 xs *s1 = xs_fmt(
1203 "<form method=\"post\" action=\"%s/admin/clear-notifications\" id=\"clear\">\n"
1204 "<input type=\"submit\" class=\"snac-btn-like\" value=\"%s\">\n"
1205 "</form><p>", snac->actor, L("Clear all"));
1206 s = xs_str_cat(s, s1);
1207
1202 while (xs_list_iter(&p, &v)) { 1208 while (xs_list_iter(&p, &v)) {
1203 xs *noti = notify_get(snac, v); 1209 xs *noti = notify_get(snac, v);
1204 1210
@@ -1865,6 +1871,13 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
1865 1871
1866 status = 303; 1872 status = 303;
1867 } 1873 }
1874 else
1875 if (p_path && strcmp(p_path, "admin/clear-notifications") == 0) {
1876 notify_clear(&snac);
1877 timeline_touch(&snac);
1878
1879 status = 303;
1880 }
1868 1881
1869 if (status == 303) { 1882 if (status == 303) {
1870 char *redir = xs_dict_get(p_vars, "redir"); 1883 char *redir = xs_dict_get(p_vars, "redir");