@@ -25,7 +25,8 @@ defmodule Mobilizon.Service.ActivityPub do
|
||||
alias Mobilizon.Service.ActivityPub.{Activity, Convertible}
|
||||
|
||||
require Logger
|
||||
import Mobilizon.Service.ActivityPub.{Utils, Visibility}
|
||||
import Mobilizon.Service.ActivityPub.Utils
|
||||
import Mobilizon.Service.ActivityPub.Visibility
|
||||
|
||||
@doc """
|
||||
Get recipients for an activity or object
|
||||
|
||||
@@ -186,6 +186,7 @@ defmodule Mobilizon.Service.ActivityPub.Converters.Event do
|
||||
"mediaType" => "text/html",
|
||||
"startTime" => event.begins_on |> date_to_string(),
|
||||
"endTime" => event.ends_on |> date_to_string(),
|
||||
"joinOptions" => to_string(event.join_options),
|
||||
"tag" => event.tags |> build_tags(),
|
||||
"id" => event.url,
|
||||
"url" => event.url
|
||||
|
||||
@@ -315,8 +315,9 @@ defmodule Mobilizon.Service.ActivityPub.Transmogrifier do
|
||||
%{"type" => "Update", "object" => %{"type" => "Event"} = object, "actor" => actor} =
|
||||
_update
|
||||
) do
|
||||
with {:ok, %{"actor" => existing_organizer_actor_url} = _existing_event_data} <-
|
||||
with {:ok, %{"actor" => existing_organizer_actor_url} = existing_event_data} <-
|
||||
fetch_obj_helper_as_activity_streams(object),
|
||||
object <- Map.merge(existing_event_data, object),
|
||||
{:ok, %Actor{url: actor_url}} <- actor |> Utils.get_url() |> Actors.get_actor_by_url(),
|
||||
true <- Utils.get_url(existing_organizer_actor_url) == actor_url do
|
||||
ActivityPub.update(%{
|
||||
|
||||
Reference in New Issue
Block a user