diaspora: add publisher module

This commit is contained in:
William Pitcock 2019-05-20 04:16:15 +00:00
parent 2f5449df54
commit 376dc50f10
2 changed files with 30 additions and 0 deletions

View File

@ -221,6 +221,7 @@ config :pleroma, :instance,
federation_reachability_timeout_days: 7,
federation_publisher_modules: [
Pleroma.Web.ActivityPub.Publisher,
Pleroma.Web.Diaspora.Publisher,
Pleroma.Web.Websub,
Pleroma.Web.Salmon
],

View File

@ -0,0 +1,29 @@
# Pleroma: A lightweight social networking server
# Copyright _ 2017-2019 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Diaspora.Publisher do
alias Pleroma.Activity
alias Pleroma.User
def publish(%User{} = _user, %Activity{} = _activity), do: :error
def publish_one(_), do: :error
def gather_webfinger_links(%User{} = user) do
[
%{
"rel" => "http://microformats.org/profile/hcard",
"type" => "text/html",
"href" => user.ap_id <> "/hcard"
},
%{
"rel" => "http://joindiaspora.com/seed_location",
"type" => "text/html",
"href" => Pleroma.Web.Endpoint.url()
}
]
end
def gather_nodeinfo_protocol_names, do: ["diaspora"]
end