Add REST API for managing and posting to circles

Circles are the conceptual opposite of lists. A list is a subdivision
of your follows, a circle is a subdivision of your followers. Posting
to a circle means making content available to only some of your
followers. Circles have been internally supported in Mastodon for
the purposes of federation since #8950, this adds the REST API
necessary for making use of them in Mastodon itsef.
This commit is contained in:
Eugen Rochko 2020-07-19 02:05:16 +02:00
parent a29080256e
commit 6358072bc0
19 changed files with 353 additions and 4 deletions

View file

@ -66,6 +66,7 @@ Doorkeeper.configure do
:'write:accounts',
:'write:blocks',
:'write:bookmarks',
:'write:circles',
:'write:conversations',
:'write:favourites',
:'write:filters',
@ -80,6 +81,7 @@ Doorkeeper.configure do
:'read:accounts',
:'read:blocks',
:'read:bookmarks',
:'read:circles',
:'read:favourites',
:'read:filters',
:'read:follows',

View file

@ -417,6 +417,7 @@ Rails.application.routes.draw do
resources :followers, only: :index, controller: 'accounts/follower_accounts'
resources :following, only: :index, controller: 'accounts/following_accounts'
resources :lists, only: :index, controller: 'accounts/lists'
resources :circles, only: :index, controller: 'accounts/circles'
resources :identity_proofs, only: :index, controller: 'accounts/identity_proofs'
member do
@ -437,6 +438,10 @@ Rails.application.routes.draw do
resource :accounts, only: [:show, :create, :destroy], controller: 'lists/accounts'
end
resources :circles, only: [:index, :create, :show, :update, :destroy] do
resource :accounts, only: [:show, :create, :destroy], controller: 'circles/accounts'
end
namespace :featured_tags do
get :suggestions, to: 'suggestions#index'
end