projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[#1501] Made user feed contain public and unlisted activities.
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
relay.ex
diff --git
a/lib/pleroma/web/activity_pub/relay.ex
b/lib/pleroma/web/activity_pub/relay.ex
index 729c23af7c275f8f5956134381cb17a9f8acc8f5..484178edd9e266098678dff3af0d8585309a7b36 100644
(file)
--- a/
lib/pleroma/web/activity_pub/relay.ex
+++ b/
lib/pleroma/web/activity_pub/relay.ex
@@
-4,9
+4,10
@@
defmodule Pleroma.Web.ActivityPub.Relay do
alias Pleroma.Activity
defmodule Pleroma.Web.ActivityPub.Relay do
alias Pleroma.Activity
- alias Pleroma.Object
alias Pleroma.User
alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.User
alias Pleroma.Web.ActivityPub.ActivityPub
+ alias Pleroma.Web.ActivityPub.Visibility
+ alias Pleroma.Web.CommonAPI
require Logger
@relay_nickname "relay"
require Logger
@relay_nickname "relay"
@@
-48,11
+49,11
@@
defmodule Pleroma.Web.ActivityPub.Relay do
end
end
end
end
- @spec publish(any()) :: {:ok, Activity.t()
, Object.t()
} | {:error, any()}
+ @spec publish(any()) :: {:ok, Activity.t()} | {:error, any()}
def publish(%Activity{data: %{"type" => "Create"}} = activity) do
with %User{} = user <- get_actor(),
def publish(%Activity{data: %{"type" => "Create"}} = activity) do
with %User{} = user <- get_actor(),
-
%Object{} = object <- Object.normalize
(activity) do
-
ActivityPub.announce(user, object, nil, true, false
)
+
true <- Visibility.is_public?
(activity) do
+
CommonAPI.repeat(activity.id, user
)
else
error -> format_error(error)
end
else
error -> format_error(error)
end