ChatView: Add a mastodon api representation of the recipient.
[akkoma] / lib / pleroma / web / activity_pub / transmogrifier / chat_message_handling.ex
index 11bd10456150febe5925ee402bc4d8715656f9f3..cfe3b767b9e58aa79bac39c24fb1decb50d52caf 100644 (file)
@@ -22,6 +22,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.ChatMessageHandling do
          # For now, just strip HTML
          stripped_content = Pleroma.HTML.strip_tags(object_cast_data["content"]),
          object_cast_data = object_cast_data |> Map.put("content", stripped_content),
+         {_, true} <- {:to_fields_match, cast_data["to"] == object_cast_data["to"]},
          {_, {:ok, validated_object, _meta}} <-
            {:validate_object, ObjectValidator.validate(object_cast_data, %{})},
          {_, {:ok, _created_object}} <- {:persist_object, Object.create(validated_object)},