Merge branch 'add-local-field-to-status' into 'develop'

MastoAPI StatusView: Add locality indicator.

See merge request pleroma/pleroma!920
This commit is contained in:
lambda 2019-03-11 13:26:12 +00:00
commit 2c8deecdd2
3 changed files with 18 additions and 3 deletions

View File

@ -13,3 +13,9 @@ Some apps operate under the assumption that no more than 4 attachments can be re
## Timelines
Adding the parameter `with_muted=true` to the timeline queries will also return activities by muted (not by blocked!) users.
## Statuses
Has these additional fields under the `pleroma` object:
- `local`: true if the post was made on the local instance.

View File

@ -102,7 +102,10 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
website: nil
},
language: nil,
emojis: []
emojis: [],
pleroma: %{
local: activity.local
}
}
end
@ -181,7 +184,10 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
website: nil
},
language: nil,
emojis: build_emojis(activity.data["object"]["emoji"])
emojis: build_emojis(activity.data["object"]["emoji"]),
pleroma: %{
local: activity.local
}
}
end

View File

@ -120,7 +120,10 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
static_url: "corndog.png",
visible_in_picker: false
}
]
],
pleroma: %{
local: true
}
}
assert status == expected