diff options
author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-07-09 12:10:26 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-07-09 12:10:26 +0000 |
commit | bdc7b60610af7e1c9df7f01aa94c8992a3d6a516 (patch) | |
tree | 31378634db69a7dfb9d280e199da8d87517db7c6 /lib | |
parent | 68036f5a3b7b609f4464650c2ae40b9679d45291 (diff) | |
parent | c0385cf47ae9c2dac527387225dee7d45dd33d8c (diff) | |
download | pleroma-bdc7b60610af7e1c9df7f01aa94c8992a3d6a516.tar.gz |
Merge branch '1925-muting-reblogs' into 'develop'
AccountController: Fix muting / unmuting reblogs.
Closes #1925
See merge request pleroma/pleroma!2732
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/api_spec/operations/account_operation.ex | 23 | ||||
-rw-r--r-- | lib/pleroma/web/mastodon_api/controllers/account_controller.ex | 2 |
2 files changed, 17 insertions, 8 deletions
diff --git a/lib/pleroma/web/api_spec/operations/account_operation.ex b/lib/pleroma/web/api_spec/operations/account_operation.ex index 9bde8fc0d..989bab122 100644 --- a/lib/pleroma/web/api_spec/operations/account_operation.ex +++ b/lib/pleroma/web/api_spec/operations/account_operation.ex @@ -203,14 +203,23 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do security: [%{"oAuth" => ["follow", "write:follows"]}], description: "Follow the given account", parameters: [ - %Reference{"$ref": "#/components/parameters/accountIdOrNickname"}, - Operation.parameter( - :reblogs, - :query, - BooleanLike, - "Receive this account's reblogs in home timeline? Defaults to true." - ) + %Reference{"$ref": "#/components/parameters/accountIdOrNickname"} ], + requestBody: + request_body( + "Parameters", + %Schema{ + type: :object, + properties: %{ + reblogs: %Schema{ + type: :boolean, + description: "Receive this account's reblogs in home timeline? Defaults to true.", + default: true + } + } + }, + required: false + ), responses: %{ 200 => Operation.response("Relationship", "application/json", AccountRelationship), 400 => Operation.response("Error", "application/json", ApiError), diff --git a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex index d4532258c..fd89faf02 100644 --- a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex @@ -353,7 +353,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do {:error, "Can not follow yourself"} end - def follow(%{assigns: %{user: follower, account: followed}} = conn, params) do + def follow(%{body_params: params, assigns: %{user: follower, account: followed}} = conn, _) do with {:ok, follower} <- MastodonAPI.follow(follower, followed, params) do render(conn, "relationship.json", user: follower, target: followed) else |