Browse Source

Connect attachments with objects, not activities.

tags/v0.9.9
Roger Braun 7 years ago
parent
commit
2e89d505d3
4 changed files with 9 additions and 9 deletions
  1. +1
    -1
      lib/pleroma/web/twitter_api/representers/activity_representer.ex
  2. +3
    -3
      lib/pleroma/web/twitter_api/twitter_api.ex
  3. +4
    -4
      test/web/twitter_api/representers/activity_representer_test.exs
  4. +1
    -1
      test/web/twitter_api/twitter_api_test.exs

+ 1
- 1
lib/pleroma/web/twitter_api/representers/activity_representer.ex View File

@@ -17,7 +17,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
"created_at" => published,
"in_reply_to_status_id" => activity.data["object"]["inReplyToStatusId"],
"statusnet_conversation_id" => activity.data["object"]["statusnetConversationId"],
"attachments" => (activity.data["attachment"] || []) |> ObjectRepresenter.enum_to_list(opts)
"attachments" => (activity.data["object"]["attachment"] || []) |> ObjectRepresenter.enum_to_list(opts)
}
end
end

+ 3
- 3
lib/pleroma/web/twitter_api/twitter_api.ex View File

@@ -24,11 +24,11 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
"type" => "Note",
"content" => data["status"],
"published" => date,
"context" => context
"context" => context,
"attachment" => attachments
},
"published" => date,
"context" => context,
"attachment" => attachments
"context" => context
}

# Wire up reply info.


+ 4
- 4
test/web/twitter_api/representers/activity_representer_test.exs View File

@@ -33,16 +33,16 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do
User.ap_followers(user),
"https://www.w3.org/ns/activitystreams#Public"
],
"attachment" => [
object
],
"actor" => User.ap_id(user),
"object" => %{
"published" => date,
"type" => "Note",
"content" => content,
"inReplyToStatusId" => 213123,
"statusnetConversationId" => 4711
"statusnetConversationId" => 4711,
"attachment" => [
object
]
},
"published" => date
}


+ 1
- 1
test/web/twitter_api/twitter_api_test.exs View File

@@ -40,7 +40,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
assert get_in(activity.data, ["object", "statusnetConversationId"]) == activity.id
assert get_in(activity.data, ["statusnetConversationId"]) == activity.id

assert is_list(activity.data["attachment"])
assert is_list(activity.data["object"]["attachment"])
end

test "create a status that is a reply" do


Loading…
Cancel
Save