X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fstreamer.ex;h=27e8020f4ce198f005ada07b2cdeddae51452805;hb=ca5d894e6811e0020facabdaa12d2fd263b497c5;hp=4de7608e4c683d789cbf80779101136739770c4d;hpb=305d2194136d4560e02c110d528164034d3727b2;p=akkoma diff --git a/lib/pleroma/web/streamer.ex b/lib/pleroma/web/streamer.ex index 4de7608e4..27e8020f4 100644 --- a/lib/pleroma/web/streamer.ex +++ b/lib/pleroma/web/streamer.ex @@ -10,7 +10,7 @@ defmodule Pleroma.Web.Streamer do alias Pleroma.Activity alias Pleroma.Object alias Pleroma.Repo - alias Pleroma.Web.ActivityPub.ActivityPub + alias Pleroma.Web.ActivityPub.Visibility @keepalive_interval :timer.seconds(30) @@ -73,7 +73,7 @@ defmodule Pleroma.Web.Streamer do def handle_cast(%{action: :stream, topic: "list", item: item}, topics) do # filter the recipient list if the activity is not public, see #270. recipient_lists = - case ActivityPub.is_public?(item) do + case Visibility.is_public?(item) do true -> Pleroma.List.get_lists_from_activity(item) @@ -82,7 +82,7 @@ defmodule Pleroma.Web.Streamer do |> Enum.filter(fn list -> owner = Repo.get(User, list.user_id) - ActivityPub.visible_for_user?(item, owner) + Visibility.visible_for_user?(item, owner) end) end @@ -197,10 +197,12 @@ defmodule Pleroma.Web.Streamer do if socket.assigns[:user] do user = User.get_cached_by_ap_id(socket.assigns[:user].ap_id) blocks = user.info.blocks || [] + mutes = user.info.mutes || [] parent = Object.normalize(item.data["object"]) - unless is_nil(parent) or item.actor in blocks or parent.data["actor"] in blocks do + unless is_nil(parent) or item.actor in blocks or item.actor in mutes or + parent.data["actor"] in blocks or parent.data["actor"] in mutes do send(socket.transport_pid, {:text, represent_update(item, user)}) end else @@ -224,8 +226,9 @@ defmodule Pleroma.Web.Streamer do if socket.assigns[:user] do user = User.get_cached_by_ap_id(socket.assigns[:user].ap_id) blocks = user.info.blocks || [] + mutes = user.info.mutes || [] - unless item.actor in blocks do + unless item.actor in blocks or item.actor in mutes do send(socket.transport_pid, {:text, represent_update(item, user)}) end else