summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-04-11 05:22:40 +0200
committerdefault <nobody@localhost>2024-04-11 05:22:40 +0200
commit21c0bdb6f2eccdc1d26b660e3a759ae7b23966de (patch)
tree97abd72cf182c8c8d97e947178233751807a8725 /html.c
parent877fb079f34f10c857c42cd04ffd0b5e0cd4ca69 (diff)
Added Unlike and Unboost buttons to web interface.
Diffstat (limited to 'html.c')
-rw-r--r--html.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/html.c b/html.c
index 8813994..00c5113 100644
--- a/html.c
+++ b/html.c
@@ -1249,6 +1249,11 @@ xs_html *html_entry_controls(snac *snac, char *actor, const xs_dict *msg, const
xs_html_add(form,
html_button("like", L("Like"), L("Say you like this post")));
}
+ else {
+ /* not like it anymore */
+ xs_html_add(form,
+ html_button("unlike", L("Unlike"), L("Nah don't like it that much")));
+ }
}
else {
if (is_pinned(snac, id))
@@ -1265,6 +1270,11 @@ xs_html *html_entry_controls(snac *snac, char *actor, const xs_dict *msg, const
xs_html_add(form,
html_button("boost", L("Boost"), L("Announce this post to your followers")));
}
+ else {
+ /* already boosted; add button to regret */
+ xs_html_add(form,
+ html_button("unboost", L("Unboost"), L("I regret I boosted this")));
+ }
}
if (strcmp(actor, snac->actor) != 0) {
@@ -2947,6 +2957,21 @@ int html_post_handler(const xs_dict *req, const char *q_path,
timeline_admire(&snac, xs_dict_get(msg, "object"), snac.actor, 0);
}
}
+ if (strcmp(action, L("Unlike")) == 0) { /** **/
+ xs *msg = msg_repulsion(&snac, id, "Like");
+
+ if (msg != NULL) {
+ enqueue_message(&snac, msg);
+ }
+ }
+ else
+ if (strcmp(action, L("Unboost")) == 0) { /** **/
+ xs *msg = msg_repulsion(&snac, id, "Announce");
+
+ if (msg != NULL) {
+ enqueue_message(&snac, msg);
+ }
+ }
else
if (strcmp(action, L("MUTE")) == 0) { /** **/
mute(&snac, actor);