Fix sending group events to followers on Mastodon
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
d7fd30f8e6
commit
08f35169d1
@ -458,10 +458,8 @@ defmodule Mobilizon.Federation.ActivityPub.Utils do
|
|||||||
Logger.debug("Making announce data for a group private object")
|
Logger.debug("Making announce data for a group private object")
|
||||||
|
|
||||||
to =
|
to =
|
||||||
(object["to"] || [])
|
Map.get(object, "to", []) ++
|
||||||
|> MapSet.new()
|
Map.get(object, "cc", []) ++ [actor.followers_url, actor.members_url]
|
||||||
|> MapSet.intersection(MapSet.new([actor.followers_url, actor.members_url]))
|
|
||||||
|> MapSet.to_list()
|
|
||||||
|
|
||||||
{to, []}
|
{to, []}
|
||||||
else
|
else
|
||||||
@ -478,6 +476,11 @@ defmodule Mobilizon.Federation.ActivityPub.Utils do
|
|||||||
"cc" => cc
|
"cc" => cc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data =
|
||||||
|
if object["attributedTo"],
|
||||||
|
do: Map.put(data, "attributedTo", object["attributedTo"]),
|
||||||
|
else: data
|
||||||
|
|
||||||
if activity_id, do: Map.put(data, "id", activity_id), else: data
|
if activity_id, do: Map.put(data, "id", activity_id), else: data
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Event do
|
|||||||
def model_to_as(%EventModel{} = event) do
|
def model_to_as(%EventModel{} = event) do
|
||||||
{to, cc} =
|
{to, cc} =
|
||||||
if event.visibility == :public,
|
if event.visibility == :public,
|
||||||
do: {[@ap_public], []},
|
do: {[@ap_public], [event.organizer_actor.followers_url]},
|
||||||
else: {[attributed_to_or_default(event).followers_url], [@ap_public]}
|
else: {[attributed_to_or_default(event).followers_url], [@ap_public]}
|
||||||
|
|
||||||
%{
|
%{
|
||||||
|
Loading…
Reference in New Issue
Block a user