X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FUnlikePage.java;h=fd9f4b1074bfa2a1a26a8ea88b5e8404e916abfe;hb=24a1147058b1a8e4c3021dd61b0b24d4e350eabb;hp=48e5ab702c085be3f52e7b08258aa36901f81bcd;hpb=95638f1b175255f63ca23f8292d71b8ee1a93de7;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/UnlikePage.java b/src/main/java/net/pterodactylus/sone/web/UnlikePage.java index 48e5ab7..fd9f4b1 100644 --- a/src/main/java/net/pterodactylus/sone/web/UnlikePage.java +++ b/src/main/java/net/pterodactylus/sone/web/UnlikePage.java @@ -18,6 +18,7 @@ package net.pterodactylus.sone.web; import net.pterodactylus.sone.data.Post; +import net.pterodactylus.sone.data.PostReply; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.web.page.FreenetRequest; import net.pterodactylus.util.template.Template; @@ -63,7 +64,10 @@ public class UnlikePage extends SoneTemplatePage { post.get().unlike(currentSone); } } else if ("reply".equals(type)) { - currentSone.removeLikedReplyId(id); + Optional postReply = webInterface.getCore().getDatabase().getPostReply(id); + if (postReply.isPresent()) { + postReply.get().unlike(currentSone); + } } throw new RedirectException(returnPage); }