projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add filter for linked images
[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
e9d79ba
..
fc39eff
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/LikePage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/LikePage.java
@@
-1,5
+1,5
@@
/*
/*
- * Sone - LikePage.java - Copyright © 2010 David Roden
+ * Sone - LikePage.java - Copyright © 2010
–2016
David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-19,8
+19,10
@@
package net.pterodactylus.sone.web;
import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.Sone;
-import net.pterodactylus.sone.web.page.
Page.Request.Method
;
+import net.pterodactylus.sone.web.page.
FreenetRequest
;
import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.Template;
+import net.pterodactylus.util.template.TemplateContext;
+import net.pterodactylus.util.web.Method;
/**
* Page that lets the user like a {@link Post}.
/**
* Page that lets the user like a {@link Post}.
@@
-38,7
+40,7
@@
public class LikePage extends SoneTemplatePage {
* The Sone web interface
*/
public LikePage(Template template, WebInterface webInterface) {
* The Sone web interface
*/
public LikePage(Template template, WebInterface webInterface) {
- super("like.html", template, "Page.Like
Post.Title", webInterfac
e);
+ super("like.html", template, "Page.Like
.Title", webInterface, tru
e);
}
//
}
//
@@
-49,12
+51,11
@@
public class LikePage extends SoneTemplatePage {
* {@inheritDoc}
*/
@Override
* {@inheritDoc}
*/
@Override
- protected void processTemplate(Request request, Template template) throws RedirectException {
- super.processTemplate(request, template);
+ protected void handleRequest(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
if (request.getMethod() == Method.POST) {
if (request.getMethod() == Method.POST) {
- String type
=
request.getHttpRequest().getPartAsStringFailsafe("type", 16);
+ String type
=
request.getHttpRequest().getPartAsStringFailsafe("type", 16);
String id = request.getHttpRequest().getPartAsStringFailsafe(type, 36);
String id = request.getHttpRequest().getPartAsStringFailsafe(type, 36);
- String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage",
64
);
+ String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage",
256
);
Sone currentSone = getCurrentSone(request.getToadletContext());
if ("post".equals(type)) {
currentSone.addLikedPostId(id);
Sone currentSone = getCurrentSone(request.getToadletContext());
if ("post".equals(type)) {
currentSone.addLikedPostId(id);
@@
-65,16
+66,4
@@
public class LikePage extends SoneTemplatePage {
}
}
}
}
- //
- // SONETEMPLATEPAGE METHODS
- //
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean requiresLogin() {
- return true;
- }
-
}
}