X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FLikePage.java;h=98777f8e0d67295eba79982554436d1c4898f2a5;hb=83f434470c6fb4d604c04a69c873d30b5fac5ec9;hp=970b4c51bc358ba3f4e7414584b38eb9bb5d1bb4;hpb=60d42fc47435de0b37710af49ad76ceb31dcfb9d;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/LikePage.java b/src/main/java/net/pterodactylus/sone/web/LikePage.java index 970b4c5..98777f8 100644 --- a/src/main/java/net/pterodactylus/sone/web/LikePage.java +++ b/src/main/java/net/pterodactylus/sone/web/LikePage.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 LikePage extends SoneTemplatePage { post.get().like(currentSone); } } else if ("reply".equals(type)) { - currentSone.addLikedReplyId(id); + Optional postReply = webInterface.getCore().getDatabase().getPostReply(id); + if (postReply.isPresent()) { + postReply.get().like(currentSone); + } } throw new RedirectException(returnPage); }