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
6b32b9e3
Commit
6b32b9e3
authored
Feb 19, 2018
by
lain
Browse files
Notifications: Use all recipients, not just "to".
parent
01faa7c5
Pipeline
#759
failed with stage
in 2 minutes and 47 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/user.ex
View file @
6b32b9e3
...
...
@@ -304,7 +304,7 @@ def update_follower_count(%User{} = user) do
update_and_set_cache
(
cs
)
end
def
get_notified_from_activity
(%
Activity
{
data:
%{
"to"
=>
to
}
})
do
def
get_notified_from_activity
(%
Activity
{
recipients:
to
})
do
query
=
from
u
in
User
,
where:
u
.
ap_id
in
^
to
,
where:
u
.
local
==
true
...
...
@@ -312,7 +312,7 @@ def get_notified_from_activity(%Activity{data: %{"to" => to}}) do
Repo
.
all
(
query
)
end
def
get_recipients_from_activity
(%
Activity
{
data:
%{
"to"
=>
to
}
})
do
def
get_recipients_from_activity
(%
Activity
{
recipients:
to
})
do
query
=
from
u
in
User
,
where:
u
.
ap_id
in
^
to
,
or_where:
fragment
(
"?
\\
\?| ?"
,
u
.
following
,
^
to
)
...
...
lib/pleroma/web/activity_pub/activity_pub_controller.ex
View file @
6b32b9e3
...
...
@@ -25,6 +25,7 @@ def object(conn, %{"uuid" => uuid}) do
# TODO: Ensure that this inbox is a recipient of the message
def
inbox
(%{
assigns:
%{
valid_signature:
true
}}
=
conn
,
params
)
do
# File.write("/tmp/incoming.json", Poison.encode!(params))
Logger
.
info
(
Poison
.
encode!
(
params
,
[
pretty:
2
]))
with
{
:ok
,
_user
}
<-
ap_enabled_actor
(
params
[
"actor"
]),
nil
<-
Activity
.
get_by_ap_id
(
params
[
"id"
]),
{
:ok
,
activity
}
<-
Transmogrifier
.
handle_incoming
(
params
)
do
...
...
Write
Preview
Markdown
is supported
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