From cff674a1034bf0454ad48231709b9954bae7da0f Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Tue, 5 Apr 2022 19:44:48 +0000 Subject: [PATCH] User ID route for blocking/mute/subscribe FossilOrigin-Name: 8a0afcd84be0e0b908a766e99a83ac6de2593c07c7088f1a023561c62c775eeb --- src/account.c | 8 ++++---- src/main.c | 2 +- static/account.html | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/account.c b/src/account.c index 3402393..4135ece 100644 --- a/src/account.c +++ b/src/account.c @@ -83,15 +83,15 @@ char* construct_account_page(mastodont_t* api, acct->display_name, acct->acct, config_url_prefix, - acct->acct, + acct->id, !relationship ? "" : MSTDNT_FLAG_ISSET(relationship->flags, MSTDNT_RELATIONSHIP_NOTIFYING) ? "un" : "", !relationship ? "" : MSTDNT_FLAG_ISSET(relationship->flags, MSTDNT_RELATIONSHIP_NOTIFYING) ? "Unsubscribe" : "Subscribe", config_url_prefix, - acct->acct, + acct->id, !relationship ? "" : MSTDNT_FLAG_ISSET(relationship->flags, MSTDNT_RELATIONSHIP_BLOCKING) ? "un" : "", !relationship ? "" : MSTDNT_FLAG_ISSET(relationship->flags, MSTDNT_RELATIONSHIP_BLOCKING) ? "Unblock" : "Block", config_url_prefix, - acct->acct, + acct->id, !relationship ? "" : MSTDNT_FLAG_ISSET(relationship->flags, MSTDNT_RELATIONSHIP_MUTING) ? "un" : "", !relationship ? "" : MSTDNT_FLAG_ISSET(relationship->flags, MSTDNT_RELATIONSHIP_MUTING) ? "Unmute" : "Mute", "Statuses", @@ -173,7 +173,7 @@ void content_account_action(struct session* ssn, mastodont_t* api, char** data) { char* referer = getenv("HTTP_REFERER"); struct mstdnt_storage storage = { 0 }; - struct mstdnt_account acct = { 0 }; + struct mstdnt_relationship acct = { 0 }; if (strcmp(data[1], "follow") == 0) mastodont_follow_account(api, data[0], &storage, &acct); diff --git a/src/main.c b/src/main.c index 0335d7b..24401f4 100644 --- a/src/main.c +++ b/src/main.c @@ -83,7 +83,7 @@ int main(void) /* { "/config/account", content_config_account }, */ { "/login", content_login }, { "/test", content_test }, - { "/@:/action/:", content_account_action }, + { "/user/:/action/:", content_account_action }, { "/@:", content_account }, { "/status/create", content_status_create }, { "/status/:/interact", status_interact }, diff --git a/static/account.html b/static/account.html index 644a482..b81d772 100644 --- a/static/account.html +++ b/static/account.html @@ -11,9 +11,9 @@ Menu