From 3e8a069f2a72bbe76c51e39d094e13de512b5491 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Sat, 6 Aug 2022 21:37:47 +0100 Subject: [PATCH] swap context clauses around --- lib/pleroma/web/mastodon_api/views/status_view.ex | 6 +++--- priv/repo/migrations/20220806014830_remove_null_objects.exs | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index e2edf004b..badb69d63 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -57,12 +57,12 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do end) end - defp get_context_id(%{data: %{"context_id" => context_id}}) when not is_nil(context_id), - do: context_id - defp get_context_id(%{data: %{"context" => context}}) when is_binary(context), do: :erlang.crc32(context) + defp get_context_id(%{data: %{"context_id" => context_id}}) when not is_nil(context_id), + do: context_id + defp get_context_id(_), do: nil # Check if the user reblogged this status diff --git a/priv/repo/migrations/20220806014830_remove_null_objects.exs b/priv/repo/migrations/20220806014830_remove_null_objects.exs index f1ab196ff..308c3dbf0 100644 --- a/priv/repo/migrations/20220806014830_remove_null_objects.exs +++ b/priv/repo/migrations/20220806014830_remove_null_objects.exs @@ -6,6 +6,7 @@ defmodule Pleroma.Repo.Migrations.RemoveNullObjects do DELETE FROM objects WHERE (data->>'type') is null; """ + execute(statement) end