fixed notifications API completely breaking if there's a like for
authorHenry Jameson <me@hjkos.com>
Wed, 22 Aug 2018 13:10:59 +0000 (16:10 +0300)
committerHenry Jameson <me@hjkos.com>
Wed, 22 Aug 2018 13:10:59 +0000 (16:10 +0300)
missing (deleted) post.

lib/pleroma/web/twitter_api/views/activity_view.ex

index 55b5287f5e2bb4e94cfcde2bdc7ea646a2009f00..0efc0df2e88abba717072a1c3d68ac7259025bca 100644 (file)
@@ -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(