forked from AkkomaGang/akkoma
Connect attachments with objects, not activities.
This commit is contained in:
parent
6aa1523bb3
commit
2e89d505d3
4 changed files with 9 additions and 9 deletions
|
@ -17,7 +17,7 @@ def to_map(%Activity{} = activity, %{user: user} = opts) 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
|
||||
|
|
|
@ -24,11 +24,11 @@ def create_status(user = %User{}, data = %{}) do
|
|||
"type" => "Note",
|
||||
"content" => data["status"],
|
||||
"published" => date,
|
||||
"context" => context
|
||||
},
|
||||
"published" => date,
|
||||
"context" => context,
|
||||
"attachment" => attachments
|
||||
},
|
||||
"published" => date,
|
||||
"context" => context
|
||||
}
|
||||
|
||||
# Wire up reply info.
|
||||
|
|
|
@ -33,16 +33,16 @@ test "an activity" 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
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ test "create a status" 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…
Reference in a new issue