From: William Pitcock Date: Fri, 9 Nov 2018 08:55:52 +0000 (+0000) Subject: activitypub: utils: wrap Note objects in a Create when extracting mentions X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=b9871e7e5aaf59e92d0fe00e8dfe0de2855a3c12;p=akkoma activitypub: utils: wrap Note objects in a Create when extracting mentions --- diff --git a/lib/pleroma/web/activity_pub/utils.ex b/lib/pleroma/web/activity_pub/utils.ex index a9a4c895b..d438236c7 100644 --- a/lib/pleroma/web/activity_pub/utils.ex +++ b/lib/pleroma/web/activity_pub/utils.ex @@ -95,6 +95,17 @@ defmodule Pleroma.Web.ActivityPub.Utils do "#{Web.base_url()}/#{type}/#{UUID.generate()}" 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 Notification.get_notified_from_activity(%Activity{data: object}, false) end