Add some methods

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-05-19 20:29:11 +02:00
parent e47ff97ac6
commit 2f0a29aa86
3 changed files with 205 additions and 45 deletions

View File

@@ -29,7 +29,7 @@ defmodule Eventos.Service.ActivityPub do
}
# Notification.create_notifications(activity)
#stream_out(activity)
# stream_out(activity)
{:ok, activity}
else
%Activity{} = activity -> {:ok, activity}
@@ -37,6 +37,20 @@ defmodule Eventos.Service.ActivityPub do
end
end
# def stream_out(%Activity{} = activity) do
# if activity.data["type"] in ["Create", "Announce"] do
# Pleroma.Web.Streamer.stream("user", activity)
#
# if Enum.member?(activity.data["to"], "https://www.w3.org/ns/activitystreams#Public") do
# Pleroma.Web.Streamer.stream("public", activity)
#
# if activity.local do
# Pleroma.Web.Streamer.stream("public:local", activity)
# end
# end
# end
# end
def fetch_event_from_url(url) do
if object = Events.get_event_by_url!(url) do
{:ok, object}