From dd0bf855d13da19e620aa57fb4dbf22f4856c28b Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Tue, 29 Mar 2022 14:49:22 +0000 Subject: [PATCH] Unlike, unrepeat FossilOrigin-Name: ffdf0651a0d3bd72669b663e8850b987d1b0a0d47bd703d98dea11fe5098e160 --- src/status.c | 11 +++++++---- static/status.html | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/status.c b/src/status.c index 5f8cf87..13aecee 100644 --- a/src/status.c +++ b/src/status.c @@ -87,12 +87,13 @@ int try_interact_status(mastodont_t* api, char* id) // Pretty up the type if (strcmp(post.itype, "like") == 0) - { mastodont_favourite_status(api, id, &storage, NULL); - } - else if (strcmp(post.itype, "repeat") == 0) { + else if (strcmp(post.itype, "repeat") == 0) mastodont_reblog_status(api, id, &storage, NULL); - } + else if (strcmp(post.itype, "unlike") == 0) + mastodont_unfavourite_status(api, id, &storage, NULL); + else if (strcmp(post.itype, "repeat") == 0) + mastodont_unreblog_status(api, id, &storage, NULL); mastodont_storage_cleanup(&storage); @@ -145,10 +146,12 @@ char* construct_status(struct mstdnt_status* status, reply_count ? reply_count : "", config_url_prefix, status->id, + status->reblogged ? "un" : "", status->reblogged ? "active" : "", repeat_count ? repeat_count : "", config_url_prefix, status->id, + status->favourited ? "un" : "", status->favourited ? "active" : "", favourites_count ? favourites_count : "", config_url_prefix, diff --git a/static/status.html b/static/status.html index 9fb9244..d07a6db 100644 --- a/static/status.html +++ b/static/status.html @@ -34,7 +34,7 @@
- +