MastoAPI: Implement all streaming functions.
This commit is contained in:
parent
5719f69ae3
commit
a743940463
7 changed files with 73 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue