mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 15:58:50 +00:00
Compare commits
3 Commits
v4.5.3
...
feature/ex
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8375ed1cfd | ||
|
|
3d80ba01d7 | ||
|
|
f02150468b |
8
app/controllers/api/v1/extensions_controller.rb
Normal file
8
app/controllers/api/v1/extensions_controller.rb
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
require 'mastodon/extension'
|
||||||
|
|
||||||
|
class Api::V1::ExtensionsController < Api::BaseController
|
||||||
|
def index
|
||||||
|
render json: Mastodon::Extension.all
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -27,7 +27,11 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer
|
|||||||
class EndpointsSerializer < ActiveModel::Serializer
|
class EndpointsSerializer < ActiveModel::Serializer
|
||||||
include RoutingHelper
|
include RoutingHelper
|
||||||
|
|
||||||
attributes :shared_inbox
|
attributes :extensions, :shared_inbox
|
||||||
|
|
||||||
|
def extensions
|
||||||
|
api_v1_extensions_url
|
||||||
|
end
|
||||||
|
|
||||||
def shared_inbox
|
def shared_inbox
|
||||||
inbox_url
|
inbox_url
|
||||||
|
|||||||
@@ -238,6 +238,8 @@ Rails.application.routes.draw do
|
|||||||
post :unmute
|
post :unmute
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
resources :extensions, only: :index
|
||||||
end
|
end
|
||||||
|
|
||||||
namespace :web do
|
namespace :web do
|
||||||
|
|||||||
17
lib/mastodon/extensions.rb
Normal file
17
lib/mastodon/extensions.rb
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
class Mastodon::Extension
|
||||||
|
@@extensions = []
|
||||||
|
|
||||||
|
def self.register url
|
||||||
|
@extensions << Extension.new(url)
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.all
|
||||||
|
@extensions
|
||||||
|
end
|
||||||
|
|
||||||
|
def initialize url
|
||||||
|
@url = url
|
||||||
|
end
|
||||||
|
|
||||||
|
attr_reader :url
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user