mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-24 16:43:36 +00:00
New button to clear all notifications.
This commit is contained in:
parent
7bec30ee52
commit
048ee35039
1 changed files with 13 additions and 0 deletions
13
html.c
13
html.c
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue