mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 14:35:04 +00:00
Likes and Boosts can be done from the web interface.
This commit is contained in:
parent
118ebac622
commit
4176799296
1 changed files with 24 additions and 0 deletions
24
html.c
24
html.c
|
@ -810,6 +810,30 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
|
|||
else
|
||||
if (p_path && strcmp(p_path, "admin/action") == 0) {
|
||||
/* action on an entry */
|
||||
char *id = xs_dict_get(p_vars, "id");
|
||||
char *actor = xs_dict_get(p_vars, "actor");
|
||||
char *action = xs_dict_get(p_vars, "action");
|
||||
|
||||
if (action == NULL)
|
||||
return 404;
|
||||
|
||||
if (strcmp(action, "Like") == 0) {
|
||||
xs *msg = msg_admiration(&snac, id, "Like");
|
||||
post(&snac, msg);
|
||||
timeline_admire(&snac, id, snac.actor, 1);
|
||||
|
||||
status = 303;
|
||||
}
|
||||
else
|
||||
if (strcmp(action, "Boost") == 0) {
|
||||
xs *msg = msg_admiration(&snac, id, "Announce");
|
||||
post(&snac, msg);
|
||||
timeline_admire(&snac, id, snac.actor, 0);
|
||||
|
||||
status = 303;
|
||||
}
|
||||
else
|
||||
status = 404;
|
||||
}
|
||||
else
|
||||
if (p_path && strcmp(p_path, "admin/user-setup") == 0) {
|
||||
|
|
Loading…
Reference in a new issue