Stream marker updates
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
parent
d1d7dd1827
commit
32bc8ec580
5 changed files with 68 additions and 6 deletions
|
|
@ -10,6 +10,7 @@ defmodule Pleroma.Web.Streamer do
|
|||
alias Pleroma.Chat.MessageReference
|
||||
alias Pleroma.Config
|
||||
alias Pleroma.Conversation.Participation
|
||||
alias Pleroma.Marker
|
||||
alias Pleroma.Notification
|
||||
alias Pleroma.Object
|
||||
alias Pleroma.User
|
||||
|
|
@ -321,6 +322,16 @@ defmodule Pleroma.Web.Streamer do
|
|||
end)
|
||||
end
|
||||
|
||||
defp do_stream(topic, %Marker{} = marker) do
|
||||
Registry.dispatch(@registry, "#{topic}:#{marker.user_id}", fn list ->
|
||||
Enum.each(list, fn {pid, _auth} ->
|
||||
text = StreamerView.render("marker.json", marker)
|
||||
|
||||
send(pid, {:text, text})
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
defp do_stream(topic, item) do
|
||||
Logger.debug("Trying to push to #{topic}")
|
||||
Logger.debug("Pushing item to #{topic}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue