Stream follow updates

This commit is contained in:
Egor Kislitsyn 2020-12-02 00:17:52 +04:00
commit 35ba48494f
No known key found for this signature in database
GPG key ID: 1B49CB15B71E7805
30 changed files with 256 additions and 149 deletions

View file

@ -74,6 +74,28 @@ defmodule Pleroma.Web.StreamerView do
|> Jason.encode!()
end
def render("relationships_update.json", item) do
%{
event: "pleroma:relationships_update",
payload:
%{
state: item.state,
follower: %{
id: item.follower.id,
follower_count: item.follower.follower_count,
following_count: item.follower.following_count
},
following: %{
id: item.following.id,
follower_count: item.following.follower_count,
following_count: item.following.following_count
}
}
|> Jason.encode!()
}
|> Jason.encode!()
end
def render("conversation.json", %Participation{} = participation) do
%{
event: "conversation",