Stream out edits
This commit is contained in:
parent
fa31ae50e6
commit
8bac8147d4
5 changed files with 95 additions and 2 deletions
|
|
@ -25,6 +25,22 @@ defmodule Pleroma.Web.StreamerView do
|
|||
|> Jason.encode!()
|
||||
end
|
||||
|
||||
def render("status_update.json", %Activity{} = activity, %User{} = user) do
|
||||
activity = Activity.get_create_by_object_ap_id_with_object(activity.object.data["id"])
|
||||
|
||||
%{
|
||||
event: "status.update",
|
||||
payload:
|
||||
Pleroma.Web.MastodonAPI.StatusView.render(
|
||||
"show.json",
|
||||
activity: activity,
|
||||
for: user
|
||||
)
|
||||
|> Jason.encode!()
|
||||
}
|
||||
|> Jason.encode!()
|
||||
end
|
||||
|
||||
def render("notification.json", %Notification{} = notify, %User{} = user) do
|
||||
%{
|
||||
event: "notification",
|
||||
|
|
@ -51,6 +67,21 @@ defmodule Pleroma.Web.StreamerView do
|
|||
|> Jason.encode!()
|
||||
end
|
||||
|
||||
def render("status_update.json", %Activity{} = activity) do
|
||||
activity = Activity.get_create_by_object_ap_id_with_object(activity.object.data["id"])
|
||||
|
||||
%{
|
||||
event: "status.update",
|
||||
payload:
|
||||
Pleroma.Web.MastodonAPI.StatusView.render(
|
||||
"show.json",
|
||||
activity: activity
|
||||
)
|
||||
|> Jason.encode!()
|
||||
}
|
||||
|> Jason.encode!()
|
||||
end
|
||||
|
||||
def render("chat_update.json", %{chat_message_reference: cm_ref}) do
|
||||
# Explicitly giving the cmr for the object here, so we don't accidentally
|
||||
# send a later 'last_message' that was inserted between inserting this and
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue