Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
fe4c1d26
Commit
fe4c1d26
authored
Mar 09, 2019
by
Karen Konou
Browse files
Add ActivityPub.contain_activity checks to streamer
parent
13c298d3
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/pleroma/web/streamer.ex
View file @
fe4c1d26
...
...
@@ -12,6 +12,7 @@ defmodule Pleroma.Web.Streamer do
alias
Pleroma
.
User
alias
Pleroma
.
Web
.
ActivityPub
.
Visibility
alias
Pleroma
.
Web
.
MastodonAPI
.
NotificationView
alias
Pleroma
.
Web
.
ActivityPub
.
ActivityPub
@keepalive_interval
:timer
.
seconds
(
30
)
...
...
@@ -203,7 +204,9 @@ def push_to_socket(topics, topic, %Activity{data: %{"type" => "Announce"}} = ite
parent
=
Object
.
normalize
(
item
.
data
[
"object"
])
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
)})
end
else
...
...
@@ -233,7 +236,8 @@ def push_to_socket(topics, topic, item) do
blocks
=
user
.
info
.
blocks
||
[]
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
)})
end
else
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment