diff --git a/config/config.exs b/config/config.exs index e337f00aa..a9302efdf 100644 --- a/config/config.exs +++ b/config/config.exs @@ -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 ], diff --git a/lib/pleroma/web/diaspora/publisher.ex b/lib/pleroma/web/diaspora/publisher.ex new file mode 100644 index 000000000..86ff2db5a --- /dev/null +++ b/lib/pleroma/web/diaspora/publisher.ex @@ -0,0 +1,29 @@ +# Pleroma: A lightweight social networking server +# Copyright _ 2017-2019 Pleroma Authors +# 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