summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--html.c25
-rw-r--r--main.c1
2 files changed, 26 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);
diff --git a/main.c b/main.c
index cd1a47b..06cae78 100644
--- a/main.c
+++ b/main.c
@@ -33,6 +33,7 @@ int usage(void)
printf("actor {basedir} [{uid}] {url} Requests an actor\n");
printf("note {basedir} {uid} {text} [files...] Sends a note with optional attachments\n");
printf("boost|announce {basedir} {uid} {url} Boosts (announces) a post\n");
+ printf("unboost {basedir} {uid} {url} Unboosts a post\n");
printf("resetpwd {basedir} {uid} Resets the password of a user\n");
printf("ping {basedir} {uid} {actor} Pings an actor\n");
printf("webfinger_s {basedir} {uid} {actor} Queries about an actor (@user@host or actor url)\n");