mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-23 01:35:28 +00:00
Add ostatus conversation as context.
This commit is contained in:
parent
6c5f5e18ec
commit
b438ea24ee
|
@ -41,7 +41,12 @@ defmodule Pleroma.Web.OStatus do
|
||||||
[author] = :xmerl_xpath.string('/entry/author[1]', doc)
|
[author] = :xmerl_xpath.string('/entry/author[1]', doc)
|
||||||
{:ok, actor} = find_or_make_user(author)
|
{: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 = [
|
to = [
|
||||||
"https://www.w3.org/ns/activitystreams#Public"
|
"https://www.w3.org/ns/activitystreams#Public"
|
||||||
|
|
|
@ -9,6 +9,7 @@ defmodule Pleroma.Web.OStatusTest do
|
||||||
assert activity.data["type"] == "Create"
|
assert activity.data["type"] == "Create"
|
||||||
assert activity.data["object"]["type"] == "Note"
|
assert activity.data["object"]["type"] == "Note"
|
||||||
assert activity.data["published"] == "2017-04-23T14:51:03+00:00"
|
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
|
end
|
||||||
|
|
||||||
describe "new remote user creation" do
|
describe "new remote user creation" do
|
||||||
|
|
Loading…
Reference in a new issue