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
b438ea24
Commit
b438ea24
authored
Apr 25, 2017
by
lain
Browse files
Add ostatus conversation as context.
parent
6c5f5e18
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/ostatus/ostatus.ex
View file @
b438ea24
...
...
@@ -41,7 +41,12 @@ def handle_note(doc) do
[
author
]
=
:xmerl_xpath
.
string
(
'/entry/author[1]'
,
doc
)
{
:ok
,
actor
}
=
find_or_make_user
(
author
)
context
=
ActivityPub
.
generate_context_id
context
=
string_from_xpath
(
"/entry/ostatus:conversation[1]"
,
doc
)
|>
String
.
trim
context
=
if
String
.
length
(
context
)
>
0
do
context
else
ActivityPub
.
generate_context_id
end
to
=
[
"https://www.w3.org/ns/activitystreams#Public"
...
...
lib/pleroma/web/twitter_api/twitter_api.ex
View file @
b438ea24
...
...
@@ -253,7 +253,7 @@ def register_user(params) do
{
:error
,
changeset
}
->
errors
=
Ecto
.
Changeset
.
traverse_errors
(
changeset
,
fn
{
msg
,
_opts
}
->
msg
end
)
|>
Poison
.
encode!
{
:error
,
%{
error:
errors
}}
{
:error
,
%{
error:
errors
}}
end
end
...
...
test/web/ostatus/ostatus_test.exs
View file @
b438ea24
...
...
@@ -9,6 +9,7 @@ test "handle incoming notes" do
assert
activity
.
data
[
"type"
]
==
"Create"
assert
activity
.
data
[
"object"
][
"type"
]
==
"Note"
assert
activity
.
data
[
"published"
]
==
"2017-04-23T14:51:03+00:00"
assert
activity
.
data
[
"context"
]
==
"tag:gs.example.org:4040,2017-04-23:objectType=thread:nonce=f09e22f58abd5c7b"
end
describe
"new remote user creation"
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