diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2022-06-04 21:16:44 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2022-06-04 21:16:44 +0200 |
commit | bee2677e895eda5de109c103494791f73b56c256 (patch) | |
tree | 8004ad3e1cd8d44acd1de7fc840603d2d9a79713 /src/main/java/eu | |
parent | 8dcc6ae4ee418cdfdc60c76709ad03b4814fb83a (diff) |
KB66 Assign comment owner if logged in.
Change-Id: I63cb2c2350f5183b7fbca335df8a06425193e015
Diffstat (limited to 'src/main/java/eu')
-rw-r--r-- | src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java | 5 |
1 files changed, 5 insertions, 0 deletions
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); |