activitypub: utils: wrap Note objects in a Create when extracting mentions

This commit is contained in:
William Pitcock 2018-11-09 08:55:52 +00:00
parent 8c805ada32
commit b9871e7e5a

View file

@ -95,6 +95,17 @@ def generate_id(type) do
"#{Web.base_url()}/#{type}/#{UUID.generate()}" "#{Web.base_url()}/#{type}/#{UUID.generate()}"
end end
def get_notified_from_object(%{"type" => type} = object) when type == "Note" do
fake_create_activity = %{
"to" => object["to"],
"cc" => object["cc"],
"type" => "Create",
"object" => object
}
Notification.get_notified_from_activity(%Activity{data: fake_create_activity}, false)
end
def get_notified_from_object(object) do def get_notified_from_object(object) do
Notification.get_notified_from_activity(%Activity{data: object}, false) Notification.get_notified_from_activity(%Activity{data: object}, false)
end end