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
b34b046f
Commit
b34b046f
authored
May 03, 2017
by
lain
Browse files
Add user to announced status.
parent
861a294c
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/ostatus/activity_representer.ex
View file @
b34b046f
...
...
@@ -98,7 +98,7 @@ def to_simple_form(%{data: %{"type" => "Announce"}} = activity, user, with_autho
retweeted_activity
=
Activity
.
get_create_activity_by_object_ap_id
(
activity
.
data
[
"object"
])
retweeted_user
=
User
.
get_cached_by_ap_id
(
retweeted_activity
.
data
[
"actor"
])
retweeted_xml
=
to_simple_form
(
retweeted_activity
,
retweeted_user
)
retweeted_xml
=
to_simple_form
(
retweeted_activity
,
retweeted_user
,
true
)
mentions
=
activity
.
data
[
"to"
]
|>
get_mentions
[
...
...
test/web/ostatus/activity_representer_test.exs
View file @
b34b046f
...
...
@@ -84,9 +84,9 @@ test "an announce activity" do
note_user
=
User
.
get_cached_by_ap_id
(
note
.
data
[
"actor"
])
note
=
Repo
.
get
(
Activity
,
note
.
id
)
note_xml
=
ActivityRepresenter
.
to_simple_form
(
note
,
note_user
)
note_xml
=
ActivityRepresenter
.
to_simple_form
(
note
,
note_user
,
true
)
|>
:xmerl
.
export_simple_content
(
:xmerl_xml
)
|>
IO
.
iodata_to_binary
|>
to_string
updated_at
=
announce
.
updated_at
|>
NaiveDateTime
.
to_iso8601
...
...
@@ -111,7 +111,7 @@ test "an announce activity" do
announce_xml
=
ActivityRepresenter
.
to_simple_form
(
announce
,
user
)
|>
:xmerl
.
export_simple_content
(
:xmerl_xml
)
|>
IO
.
iodata_to_binary
|>
to_string
assert
clean
(
expected
)
==
clean
(
announce_xml
)
end
...
...
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