fix(event announcements): only show comments from event organizers in event announcement list

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2024-01-05 16:41:10 +01:00
parent 387d3b1c30
commit 01eecbf1d4
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
1 changed files with 4 additions and 0 deletions

View File

@ -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,