From f4f21f18add10c6a1c95f70faf851f06920dc77b Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 5 Nov 2019 20:25:20 +0100 Subject: [PATCH] =?utf8?q?=F0=9F=9A=A7=20Lock=20Sone=20if=20after=20loadin?= =?utf8?q?g=20it=E2=80=99s=20empty?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/core/Core.java | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- 2.7.4