Skip to content
Snippets Groups Projects
Commit d4de38e8 authored by lain's avatar lain
Browse files

Order conversation fetches like GS does.

parent 6a444279
No related branches found
No related tags found
No related merge requests found
......@@ -77,7 +77,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
def fetch_activities_for_context(context) do
query = from activity in Activity,
where: fragment("? @> ?", activity.data, ^%{ context: context })
where: fragment("? @> ?", activity.data, ^%{ context: context }),
order_by: [desc: :inserted_at]
Repo.all(query)
end
......
......@@ -75,7 +75,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
activities = ActivityPub.fetch_activities_for_context("2hu")
assert activities == [activity, activity_two]
assert activities == [activity_two, activity]
end
end
......
......@@ -227,8 +227,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
statuses = TwitterAPI.fetch_conversation(user, object.id)
assert length(statuses) == 2
assert Enum.at(statuses, 0)["id"] == activity.id
assert Enum.at(statuses, 1)["id"] == activity_two.id
assert Enum.at(statuses, 1)["id"] == activity.id
assert Enum.at(statuses, 0)["id"] == activity_two.id
end
test "upload a file" do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment