diff options
author | lambda <pleromagit@rogerbraun.net> | 2019-03-11 13:26:12 +0000 |
---|---|---|
committer | lambda <pleromagit@rogerbraun.net> | 2019-03-11 13:26:12 +0000 |
commit | 2c8deecdd2f75c6cdf1089e4266bedb8be55539c (patch) | |
tree | e45dac3ef09fccdd705dffde41156bc420eac772 | |
parent | d9ae2d00a157fad25bf29638550e487ff1800af3 (diff) | |
parent | 66774b5567c10005b2be810433d7f3d401e12520 (diff) | |
download | pleroma-2c8deecdd2f75c6cdf1089e4266bedb8be55539c.tar.gz pleroma-2c8deecdd2f75c6cdf1089e4266bedb8be55539c.zip |
Merge branch 'add-local-field-to-status' into 'develop'
MastoAPI StatusView: Add locality indicator.
See merge request pleroma/pleroma!920
-rw-r--r-- | docs/Differences-in-MastodonAPI-Responses.md | 6 | ||||
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/status_view.ex | 10 | ||||
-rw-r--r-- | test/web/mastodon_api/status_view_test.exs | 5 |
3 files changed, 18 insertions, 3 deletions
diff --git a/docs/Differences-in-MastodonAPI-Responses.md b/docs/Differences-in-MastodonAPI-Responses.md index 3026e1173..667664f4e 100644 --- a/docs/Differences-in-MastodonAPI-Responses.md +++ b/docs/Differences-in-MastodonAPI-Responses.md @@ -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. diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index 3468c0e1c..bf3aaf025 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -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 diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs index 351dbf673..485a0b4f7 100644 --- a/test/web/mastodon_api/status_view_test.exs +++ b/test/web/mastodon_api/status_view_test.exs @@ -120,7 +120,10 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do static_url: "corndog.png", visible_in_picker: false } - ] + ], + pleroma: %{ + local: true + } } assert status == expected |