KB46 Post#queryViewable: Fix visible posts query logic for Post.class.

Change-Id: Ic7f16a9dec8e639133ab266540b5f25d8f1594c9
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/posts/Post.java b/src/main/java/eu/mulk/mulkcms2/benki/posts/Post.java
index 356461c..654db5f 100644
--- a/src/main/java/eu/mulk/mulkcms2/benki/posts/Post.java
+++ b/src/main/java/eu/mulk/mulkcms2/benki/posts/Post.java
@@ -126,12 +126,14 @@
 
       var root = query.from(User.class);
       conditions.add(cb.equal(root, user));
-      if (entityClass.isAssignableFrom(Bookmark.class)) {
+      if (entityClass.isAssignableFrom(Post.class)) {
+        post = (From<?, T>) root.join(User_.visiblePosts);
+      } else if (entityClass.isAssignableFrom(Bookmark.class)) {
         post = (From<?, T>) root.join(User_.visibleBookmarks);
       } else if (entityClass.isAssignableFrom(LazychatMessage.class)) {
         post = (From<?, T>) root.join(User_.visibleLazychatMessages);
       } else {
-        post = (From<?, T>) root.join(User_.visiblePosts);
+        throw new IllegalArgumentException();
       }
     }