package net.pterodactylus.sone.web.ajax;
import net.pterodactylus.sone.data.Post;
+import net.pterodactylus.sone.data.PostReply;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.web.WebInterface;
import net.pterodactylus.sone.web.page.FreenetRequest;
}
webInterface.getCore().touchConfiguration();
} else if ("reply".equals(type)) {
- currentSone.removeLikedReplyId(id);
+ Optional<PostReply> postReply = webInterface.getCore().getDatabase().getPostReply(id);
+ if (postReply.isPresent()) {
+ postReply.get().unlike(currentSone);
+ }
webInterface.getCore().touchConfiguration();
} else {
return createErrorJsonObject("invalid-type");