logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma
commit: 997c01be53ecb5ee65dccb84c5f21df334bea812
parent: f23edd2d6b67ee30ccd16b7a27d9e07a9f928574
Author: Roger Braun <roger@rogerbraun.net>
Date:   Tue, 31 Oct 2017 14:53:14 +0100

Merge branch 'feature/mastodon-api-fixes' into develop

Diffstat:

MREADME.md3++-
Mlib/pleroma/web/mastodon_api/views/status_view.ex8++++----
Mtest/web/mastodon_api/mastodon_api_controller_test.exs2+-
Mtest/web/mastodon_api/status_view_test.exs8++++----
4 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/README.md b/README.md @@ -6,12 +6,13 @@ Pleroma is an OStatus-compatible social networking server written in Elixir, com For clients it supports both the GNU Social API with Qvitter extensions and the Mastodon client API. -Mobile clients that are known to work: +Mobile clients that are known to work well: * Twidere * Tusky * Pawoo (Android) * Subway Tooter +* Amaroq (iOS) No release has been made yet, but several servers have been online for months already. If you want to run your own server, feel free to contact us at @lain@pleroma.soykaf.com or in our dev chat at https://matrix.heldscal.la/#/room/#pleromafe:matrix.heldscal.la. diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -21,9 +21,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do |> Enum.map(fn (user) -> AccountView.render("mention.json", %{user: user}) end) %{ - id: activity.id, + id: to_string(activity.id), uri: object, - url: nil, + url: nil, # TODO: This might be wrong, check with mastodon. account: AccountView.render("account.json", %{user: user}), in_reply_to_id: nil, in_reply_to_account_id: nil, @@ -78,9 +78,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do |> Enum.map(fn {name, url} -> %{ shortcode: name, url: url, static_url: url } end) %{ - id: activity.id, + id: to_string(activity.id), uri: object["id"], - url: object["external_url"], + url: object["external_url"] || object["id"], account: AccountView.render("account.json", %{user: user}), in_reply_to_id: reply_to && reply_to.id, in_reply_to_account_id: reply_to_user && reply_to_user.id, diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -319,7 +319,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do end) end - test "account seach", %{conn: conn} do + test "account search", %{conn: conn} do user = insert(:user) user_two = insert(:user, %{nickname: "shp@shitposter.club"}) user_three = insert(:user, %{nickname: "shp@heldscal.la", name: "I love 2hu"}) diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs @@ -17,9 +17,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do |> String.replace(~r/\.\d+Z/, ".000Z") expected = %{ - id: note.id, + id: to_string(note.id), uri: note.data["object"]["id"], - url: note.data["object"]["external_id"], + url: note.data["object"]["id"], account: AccountView.render("account.json", %{user: user}), in_reply_to_id: nil, in_reply_to_account_id: nil, @@ -101,7 +101,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do represented = StatusView.render("status.json", %{for: user, activity: reblog}) - assert represented[:id] == reblog.id - assert represented[:reblog][:id] == activity.id + assert represented[:id] == to_string(reblog.id) + assert represented[:reblog][:id] == to_string(activity.id) end end