projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add albums to Sone.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
CreatePostPage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/CreatePostPage.java
b/src/main/java/net/pterodactylus/sone/web/CreatePostPage.java
index
d2bd5da
..
a8e2128
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/CreatePostPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/CreatePostPage.java
@@
-38,7
+38,7
@@
public class CreatePostPage extends SoneTemplatePage {
* The Sone web interface
*/
public CreatePostPage(Template template, WebInterface webInterface) {
* The Sone web interface
*/
public CreatePostPage(Template template, WebInterface webInterface) {
- super("createPost.html", template, "Page.CreatePost.Title", webInterface);
+ super("createPost.html", template, "Page.CreatePost.Title", webInterface
, true
);
}
//
}
//
@@
-51,28
+51,19
@@
public class CreatePostPage extends SoneTemplatePage {
@Override
protected void processTemplate(Request request, Template template) throws RedirectException {
super.processTemplate(request, template);
@Override
protected void processTemplate(Request request, Template template) throws RedirectException {
super.processTemplate(request, template);
+ String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256);
if (request.getMethod() == Method.POST) {
String text = request.getHttpRequest().getPartAsStringFailsafe("text", 65536).trim();
if (request.getMethod() == Method.POST) {
String text = request.getHttpRequest().getPartAsStringFailsafe("text", 65536).trim();
- String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 64);
if (text.length() != 0) {
if (text.length() != 0) {
+ String recipientId = request.getHttpRequest().getPartAsStringFailsafe("recipient", 43);
+ Sone recipient = webInterface.getCore().getSone(recipientId, false);
Sone currentSone = getCurrentSone(request.getToadletContext());
Sone currentSone = getCurrentSone(request.getToadletContext());
- webInterface.
core().createPost(currentSone
, System.currentTimeMillis(), text);
+ webInterface.
getCore().createPost(currentSone, recipient
, System.currentTimeMillis(), text);
throw new RedirectException(returnPage);
}
template.set("errorTextEmpty", true);
}
throw new RedirectException(returnPage);
}
template.set("errorTextEmpty", true);
}
- }
-
- //
- // SONETEMPLATEPAGE METHODS
- //
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean requiresLogin() {
- return true;
+ template.set("returnPage", returnPage);
}
}
}
}