X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Factivity_pub%2Fbuilder.ex;h=7f9c071b33727abb852038a918f13d809ff8498a;hb=e055b8d2036e18a95d84f6f1db08fc465fe9975d;hp=f0a6c1e1b8eca57fa1a6f4b7eb0ce13413bf705e;hpb=44bfb491eae00d541e6d11c8b52b5de5bc0bd34e;p=akkoma diff --git a/lib/pleroma/web/activity_pub/builder.ex b/lib/pleroma/web/activity_pub/builder.ex index f0a6c1e1b..7f9c071b3 100644 --- a/lib/pleroma/web/activity_pub/builder.ex +++ b/lib/pleroma/web/activity_pub/builder.ex @@ -5,19 +5,21 @@ defmodule Pleroma.Web.ActivityPub.Builder do This module encodes our addressing policies and general shape of our objects. """ + alias Pleroma.Emoji alias Pleroma.Object alias Pleroma.User alias Pleroma.Web.ActivityPub.Utils alias Pleroma.Web.ActivityPub.Visibility - def create(actor, object_id, recipients) do + def create(actor, object, recipients) do {:ok, %{ "id" => Utils.generate_activity_id(), "actor" => actor.ap_id, "to" => recipients, - "object" => object_id, - "type" => "Create" + "object" => object, + "type" => "Create", + "published" => DateTime.utc_now() |> DateTime.to_iso8601() }, []} end @@ -28,7 +30,9 @@ defmodule Pleroma.Web.ActivityPub.Builder do "actor" => actor.ap_id, "type" => "ChatMessage", "to" => [recipient], - "content" => content + "content" => content, + "published" => DateTime.utc_now() |> DateTime.to_iso8601(), + "emoji" => Emoji.Formatter.get_emoji_map(content) }, []} end