forked from AkkomaGang/akkoma
fixed notifications API completely breaking if there's a like for
missing (deleted) post.
This commit is contained in:
parent
5fbb14f5ec
commit
9b046d2a84
1 changed files with 2 additions and 2 deletions
|
@ -188,7 +188,7 @@ def render("activity.json", %{activity: %{data: %{"type" => "Like"}} = activity}
|
||||||
|
|
||||||
text = "#{user.nickname} favorited a status."
|
text = "#{user.nickname} favorited a status."
|
||||||
|
|
||||||
%{
|
if liked_activity, do: %{
|
||||||
"id" => activity.id,
|
"id" => activity.id,
|
||||||
"user" => UserView.render("show.json", %{user: user, for: opts[:for]}),
|
"user" => UserView.render("show.json", %{user: user, for: opts[:for]}),
|
||||||
"statusnet_html" => text,
|
"statusnet_html" => text,
|
||||||
|
@ -200,7 +200,7 @@ def render("activity.json", %{activity: %{data: %{"type" => "Like"}} = activity}
|
||||||
"in_reply_to_status_id" => liked_activity.id,
|
"in_reply_to_status_id" => liked_activity.id,
|
||||||
"external_url" => activity.data["id"],
|
"external_url" => activity.data["id"],
|
||||||
"activity_type" => "like"
|
"activity_type" => "like"
|
||||||
}
|
}, else: %{}
|
||||||
end
|
end
|
||||||
|
|
||||||
def render(
|
def render(
|
||||||
|
|
Loading…
Reference in a new issue