From: David ‘Bombe’ Roden Date: Tue, 5 Nov 2019 19:25:20 +0000 (+0100) Subject: 🚧 Lock Sone if after loading it’s empty X-Git-Tag: v81^2~51 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f4f21f18add10c6a1c95f70faf851f06920dc77b;p=Sone.git 🚧 Lock Sone if after loading it’s empty --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 6bb664d..6525ac3 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -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; }