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