User ID route for blocking/mute/subscribe

FossilOrigin-Name: 8a0afcd84be0e0b908a766e99a83ac6de2593c07c7088f1a023561c62c775eeb
This commit is contained in:
me@ow.nekobit.net 2022-04-05 19:44:48 +00:00
parent ff3cd19926
commit cff674a103
3 changed files with 8 additions and 8 deletions

View file

@ -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);

View file

@ -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 },

View file

@ -11,9 +11,9 @@
Menu
<div class="menu menu-options">
<ul>
<li><a class="nolink" href="%s/@%s/action/%ssubscribe"><input class="btn-menu" type="button" value="%s"></a></li>
<li><a class="nolink" href="%s/@%s/action/%sblock"><input class="btn-menu" type="button" value="%s"></a></li>
<li><a class="nolink" href="%s/@%s/action/%smute"><input class="btn-menu" type="button" value="%s"></a></li>
<li><a class="nolink" href="%s/user/%s/action/%ssubscribe"><input class="btn-menu" type="button" value="%s"></a></li>
<li><a class="nolink" href="%s/user/%s/action/%sblock"><input class="btn-menu" type="button" value="%s"></a></li>
<li><a class="nolink" href="%s/user/%s/action/%smute"><input class="btn-menu" type="button" value="%s"></a></li>
</ul>
</div>
</span>