diff options
-rw-r--r-- | html.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -1199,6 +1199,12 @@ xs_str *html_notifications(snac *snac) s = html_user_header(snac, s, 0); + xs *s1 = xs_fmt( + "<form method=\"post\" action=\"%s/admin/clear-notifications\" id=\"clear\">\n" + "<input type=\"submit\" class=\"snac-btn-like\" value=\"%s\">\n" + "</form><p>", snac->actor, L("Clear all")); + s = xs_str_cat(s, s1); + while (xs_list_iter(&p, &v)) { xs *noti = notify_get(snac, v); @@ -1865,6 +1871,13 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size, status = 303; } + else + if (p_path && strcmp(p_path, "admin/clear-notifications") == 0) { + notify_clear(&snac); + timeline_touch(&snac); + + status = 303; + } if (status == 303) { char *redir = xs_dict_get(p_vars, "redir"); |