projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move reply like functionality from Sone to Reply.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
ajax
/
UnlikeAjaxPage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/ajax/UnlikeAjaxPage.java
b/src/main/java/net/pterodactylus/sone/web/ajax/UnlikeAjaxPage.java
index
5ac0ca0
..
bd5f91b
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/ajax/UnlikeAjaxPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/ajax/UnlikeAjaxPage.java
@@
-18,6
+18,7
@@
package net.pterodactylus.sone.web.ajax;
import net.pterodactylus.sone.data.Post;
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;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.web.WebInterface;
import net.pterodactylus.sone.web.page.FreenetRequest;
@@
-59,7
+60,10
@@
public class UnlikeAjaxPage extends JsonPage {
}
webInterface.getCore().touchConfiguration();
} else if ("reply".equals(type)) {
}
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");
webInterface.getCore().touchConfiguration();
} else {
return createErrorJsonObject("invalid-type");