From: Henry Jameson Date: Wed, 22 Aug 2018 13:10:59 +0000 (+0300) Subject: fixed notifications API completely breaking if there's a like for X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=9b046d2a8481c50e244071be1192830e0bbd08bc;p=akkoma fixed notifications API completely breaking if there's a like for missing (deleted) post. --- diff --git a/lib/pleroma/web/twitter_api/views/activity_view.ex b/lib/pleroma/web/twitter_api/views/activity_view.ex index 55b5287f5..0efc0df2e 100644 --- a/lib/pleroma/web/twitter_api/views/activity_view.ex +++ b/lib/pleroma/web/twitter_api/views/activity_view.ex @@ -188,7 +188,7 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do text = "#{user.nickname} favorited a status." - %{ + if liked_activity, do: %{ "id" => activity.id, "user" => UserView.render("show.json", %{user: user, for: opts[:for]}), "statusnet_html" => text, @@ -200,7 +200,7 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do "in_reply_to_status_id" => liked_activity.id, "external_url" => activity.data["id"], "activity_type" => "like" - } + }, else: %{} end def render(