mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-14 05:04:49 +00:00
Add ActivityPub.contain_activity checks to streamer
This commit is contained in:
parent
13c298d354
commit
fe4c1d26fc
1 changed files with 6 additions and 2 deletions
|
@ -12,6 +12,7 @@ defmodule Pleroma.Web.Streamer do
|
||||||
alias Pleroma.User
|
alias Pleroma.User
|
||||||
alias Pleroma.Web.ActivityPub.Visibility
|
alias Pleroma.Web.ActivityPub.Visibility
|
||||||
alias Pleroma.Web.MastodonAPI.NotificationView
|
alias Pleroma.Web.MastodonAPI.NotificationView
|
||||||
|
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||||
|
|
||||||
@keepalive_interval :timer.seconds(30)
|
@keepalive_interval :timer.seconds(30)
|
||||||
|
|
||||||
|
@ -203,7 +204,9 @@ defmodule Pleroma.Web.Streamer do
|
||||||
parent = Object.normalize(item.data["object"])
|
parent = Object.normalize(item.data["object"])
|
||||||
|
|
||||||
unless is_nil(parent) or item.actor in blocks or item.actor in mutes or
|
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
|
not ActivityPub.contain_activity(item, user) or
|
||||||
|
parent.data["actor"] in blocks or
|
||||||
|
parent.data["actor"] in mutes do
|
||||||
send(socket.transport_pid, {:text, represent_update(item, user)})
|
send(socket.transport_pid, {:text, represent_update(item, user)})
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -233,7 +236,8 @@ defmodule Pleroma.Web.Streamer do
|
||||||
blocks = user.info.blocks || []
|
blocks = user.info.blocks || []
|
||||||
mutes = user.info.mutes || []
|
mutes = user.info.mutes || []
|
||||||
|
|
||||||
unless item.actor in blocks or item.actor in mutes do
|
unless item.actor in blocks or item.actor in mutes or
|
||||||
|
not ActivityPub.contain_activity(item, user) do
|
||||||
send(socket.transport_pid, {:text, represent_update(item, user)})
|
send(socket.transport_pid, {:text, represent_update(item, user)})
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue