From bee2677e895eda5de109c103494791f73b56c256 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 4 Jun 2022 21:16:44 +0200 Subject: KB66 Assign comment owner if logged in. Change-Id: I63cb2c2350f5183b7fbca335df8a06425193e015 --- src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java b/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java index d1e5775..569c535 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java @@ -344,6 +344,11 @@ public abstract class PostResource { assignPostTargets(post.getVisibility(), post.owner, comment); comment.persist(); + var currentUser = getCurrentUser(); + if (currentUser != null) { + comment.owner = currentUser; + } + var admins = User.findAdmins(); var mailText = Templates.commentNotificationMail(postId, comment); -- cgit v1.2.3