Always create Shells with IDs.
[Sone.git] / src / main / java / net / pterodactylus / sone / data / ReplyShell.java
index 03a4c53..6886a9d 100644 (file)
@@ -27,6 +27,15 @@ import java.util.UUID;
  */
 public class ReplyShell extends Reply implements Shell<Reply> {
 
+       /** The shell creator. */
+       public static final ShellCreator<Reply> creator = new ShellCreator<Reply>() {
+
+               @Override
+               public Shell<Reply> createShell(String id) {
+                       return new ReplyShell().setId(UUID.fromString(id));
+               }
+       };
+
        /** The Sone that posted this reply. */
        private Sone sone;
 
@@ -172,7 +181,7 @@ public class ReplyShell extends Reply implements Shell<Reply> {
         */
        @Override
        public boolean canUnshell() {
-               return (sone != null) && (id != null) && (post != null) && (time != null) && (text != null);
+               return (sone != null) && (!(sone instanceof Shell<?>)) && (id != null) && (post != null) && (!(post instanceof Shell<?>)) && (time != null) && (text != null);
        }
 
        /**