Commit b91ccef2 authored by lain's avatar lain
Browse files

Output conversation id.

parent f980f677
......@@ -19,7 +19,9 @@ def to_simple_form(%{data: %{"object" => %{"type" => "Note"}}} = activity, user)
{:title, ['New note by #{user.nickname}']},
{:content, [type: 'html'], h.(activity.data["object"]["content"])},
{:published, h.(inserted_at)},
{:updated, h.(updated_at)}
{:updated, h.(updated_at)},
{:"ostatus:conversation", [], h.(activity.data["context"])},
{:link, [href: h.(activity.data["context"]), rel: 'ostatus:conversation'], []}
] ++ attachments
end
......
......@@ -17,7 +17,8 @@ def to_simple_form(user, activities, users) do
:feed, [
xmlns: 'http://www.w3.org/2005/Atom',
"xmlns:activity": 'http://activitystrea.ms/spec/1.0/',
"xmlns:poco": 'http://portablecontacts.net/spec/1.0'
"xmlns:poco": 'http://portablecontacts.net/spec/1.0',
"xmlns:ostatus": 'http://ostatus.org/schema/1.0'
], [
{:id, h.(OStatus.feed_path(user))},
{:title, ['#{user.nickname}\'s timeline']},
......
......@@ -24,7 +24,8 @@ def note_factory do
"to" => ["https://www.w3.org/ns/activitystreams#Public"],
"published_at" => DateTime.utc_now() |> DateTime.to_iso8601,
"likes" => [],
"like_count" => 0
"like_count" => 0,
"context" => "2hu"
}
%Pleroma.Object{
......@@ -40,7 +41,8 @@ def note_activity_factory do
"actor" => note.data["actor"],
"to" => note.data["to"],
"object" => note.data,
"published_at" => DateTime.utc_now() |> DateTime.to_iso8601
"published_at" => DateTime.utc_now() |> DateTime.to_iso8601,
"context" => note.data["context"]
}
%Pleroma.Activity{
......
......@@ -23,6 +23,8 @@ test "a note activity" do
<content type="html">#{note_activity.data["object"]["content"]}</content>
<published>#{inserted_at}</published>
<updated>#{updated_at}</updated>
<ostatus:conversation>#{note_activity.data["context"]}</ostatus:conversation>
<link href="#{note_activity.data["context"]}" rel="ostatus:conversation" />
"""
tuple = ActivityRepresenter.to_simple_form(note_activity, user)
......
......@@ -22,7 +22,7 @@ test "returns a feed of the last 20 items of the user" do
|> :xmerl.export_simple_content(:xmerl_xml)
expected = """
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:poco="http://portablecontacts.net/spec/1.0">
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:ostatus="http://ostatus.org/schema/1.0">
<id>#{OStatus.feed_path(user)}</id>
<title>#{user.nickname}'s timeline</title>
<updated>#{most_recent_update}</updated>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment