MastoAPI: Implement all streaming functions.

This commit is contained in:
Roger Braun 2017-11-16 16:49:51 +01:00
commit a743940463
7 changed files with 73 additions and 6 deletions

View file

@ -78,8 +78,9 @@ defmodule Pleroma.Notification do
# TODO move to sql, too.
def create_notification(%Activity{} = activity, %User{} = user) do
unless User.blocks?(user, %{ap_id: activity.data["actor"]}) do
notification = %Notification{user_id: user.id, activity_id: activity.id}
notification = %Notification{user_id: user.id, activity: activity}
{:ok, notification} = Repo.insert(notification)
Pleroma.Web.Streamer.stream("user", notification)
notification
end
end