diff --git a/lib/philomena_web/controllers/activity_controller.ex b/lib/philomena_web/controllers/activity_controller.ex index acc29ac4..f0b8f013 100644 --- a/lib/philomena_web/controllers/activity_controller.ex +++ b/lib/philomena_web/controllers/activity_controller.ex @@ -73,6 +73,7 @@ defmodule PhilomenaWeb.ActivityController do featured_image = Image |> join(:inner, [i], f in ImageFeature, on: [image_id: i.id]) + |> where([i], i.hidden_from_users == false) |> filter_hidden(user, conn.params["hidden"]) |> order_by([i, f], desc: f.created_at) |> limit(1) diff --git a/lib/philomena_web/controllers/api/json/image/featured_controller.ex b/lib/philomena_web/controllers/api/json/image/featured_controller.ex index 3287cafb..6a2c5909 100644 --- a/lib/philomena_web/controllers/api/json/image/featured_controller.ex +++ b/lib/philomena_web/controllers/api/json/image/featured_controller.ex @@ -13,6 +13,7 @@ defmodule PhilomenaWeb.Api.Json.Image.FeaturedController do featured_image = Image |> join(:inner, [i], f in ImageFeature, on: [image_id: i.id]) + |> where([i], i.hidden_from_users == false) |> order_by([_i, f], desc: f.created_at) |> limit(1) |> preload([:user, :intensity, tags: :aliases])