summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-11-19 19:14:35 +0300
committerrinpatch <rinpatch@sdf.org>2019-11-19 19:14:35 +0300
commitb74f4260ae8367b33d133298a96fed9d1080ef5c (patch)
tree52846315b01ba52588d74c711f2d0f0bbff674b0
parent36f4382b3367a889a191b124066fbbafab37d047 (diff)
Fix rendering conversations when there's a malformed status
-rw-r--r--CHANGELOG.md4
-rw-r--r--lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex7
2 files changed, 8 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 86c0553d5..9e2010839 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
+## [1.1.6] - 2019-11-19
+## Fixed
+- Mastodon API: conversations API crashing when one status is malformed
+
## [1.1.5] - 2019-11-09
### Fixed
- Polls having different numbers in timelines/notifications/poll api endpoints due to cache desyncronization
diff --git a/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex
index 863d673ea..a5de1fecd 100644
--- a/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex
@@ -1671,9 +1671,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
participations = Participation.for_user_with_last_activity_id(user, params)
conversations =
- Enum.map(participations, fn participation ->
- ConversationView.render("participation.json", %{participation: participation, for: user})
- end)
+ ConversationView.safe_render_many(participations, ConversationView, "participation.json", %{
+ as: :participation,
+ for: user
+ })
conn
|> add_link_headers(:conversations, participations)