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
df71c142
Commit
df71c142
authored
May 03, 2017
by
lain
Browse files
Remove doubled 'to' recipients.
parent
81410242
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/activity_pub/activity_pub.ex
View file @
df71c142
...
...
@@ -24,7 +24,7 @@ def create(to, actor, context, object, additional \\ %{}, published \\ nil, loca
activity
=
%{
"type"
=>
"Create"
,
"to"
=>
to
,
"to"
=>
to
|>
Enum
.
uniq
,
"actor"
=>
actor
.
ap_id
,
"object"
=>
object
,
"published"
=>
published
,
...
...
test/web/activity_pub/activity_pub_test.exs
View file @
df71c142
...
...
@@ -40,6 +40,13 @@ test "adds an id to a given object if it lacks one and inserts it to the object
end
end
describe
"create activities"
do
test
"removes doubled 'to' recipients"
do
{
:ok
,
activity
}
=
ActivityPub
.
create
([
"user1"
,
"user1"
,
"user2"
],
%
User
{
ap_id:
"1"
},
""
,
%{})
assert
activity
.
data
[
"to"
]
==
[
"user1"
,
"user2"
]
end
end
describe
"fetch activities for recipients"
do
test
"retrieve the activities for certain recipients"
do
{
:ok
,
activity_one
}
=
ActivityBuilder
.
insert
(%{
"to"
=>
[
"someone"
]})
...
...
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