From 01eecbf1d46614241c92e1a38e30057a84c55744 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 5 Jan 2024 16:41:10 +0100 Subject: [PATCH] fix(event announcements): only show comments from event organizers in event announcement list Signed-off-by: Thomas Citharel --- lib/mobilizon/conversations/conversations.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/mobilizon/conversations/conversations.ex b/lib/mobilizon/conversations/conversations.ex index 976c34e76..996119998 100644 --- a/lib/mobilizon/conversations/conversations.ex +++ b/lib/mobilizon/conversations/conversations.ex @@ -104,6 +104,10 @@ defmodule Mobilizon.Conversations do |> join(:inner, [_cp, _c, _e, _a, _lc, _oc, p], ap in Actor, on: p.actor_id == ap.id) |> where([_cp, c], c.event_id == ^event_id) |> where([cp], cp.actor_id == ^actor_id) + |> where( + [_cp, _c, _e, _a, _lc, oc], + oc.actor_id == ^actor_id or oc.attributed_to_id == ^actor_id + ) |> order_by([cp], desc: cp.unread, desc: cp.updated_at) |> preload([_cp, c, e, a, lc, oc, p, ap], actor: a,