🚧 Lock Sone if after loading it’s empty
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 5 Nov 2019 19:25:20 +0000 (20:25 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 5 Nov 2019 19:25:20 +0000 (20:25 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java

index 6bb664d..6525ac3 100644 (file)
@@ -631,6 +631,10 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
                loadSone(sone);
                database.storeSone(sone);
                sone.setStatus(SoneStatus.idle);
+               if (sone.getPosts().isEmpty() && sone.getReplies().isEmpty()) {
+                       // dirty hack
+                       lockSone(sone);
+               }
                soneInserter.start();
                return sone;
        }