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
/
UnlikePage.java
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
(file)
--- 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;
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;
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)) {
post.get().unlike(currentSone);
}
} else if ("reply".equals(type)) {
- currentSone.removeLikedReplyId(id);
+ Optional<PostReply> postReply = webInterface.getCore().getDatabase().getPostReply(id);
+ if (postReply.isPresent()) {
+ postReply.get().unlike(currentSone);
+ }
}
throw new RedirectException(returnPage);
}
}
throw new RedirectException(returnPage);
}