*
* 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
- protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
- super.processTemplate(request, templateContext);
+ protected void handleRequest(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
String type = request.getHttpRequest().getPartAsStringFailsafe("type", 5);
if (!type.equals("sone") && !type.equals("post") && !type.equals("reply")) {
throw new RedirectException("invalid.html");
String type = request.getHttpRequest().getPartAsStringFailsafe("type", 5);
if (!type.equals("sone") && !type.equals("post") && !type.equals("reply")) {
throw new RedirectException("invalid.html");
for (StringTokenizer idTokenizer = new StringTokenizer(ids); idTokenizer.hasMoreTokens();) {
String id = idTokenizer.nextToken();
if (type.equals("post")) {
for (StringTokenizer idTokenizer = new StringTokenizer(ids); idTokenizer.hasMoreTokens();) {
String id = idTokenizer.nextToken();
if (type.equals("post")) {
} else if (type.equals("reply")) {
Optional<PostReply> reply = webInterface.getCore().getPostReply(id);
if (!reply.isPresent()) {
continue;
}
webInterface.getCore().markReplyKnown(reply.get());
} else if (type.equals("reply")) {
Optional<PostReply> reply = webInterface.getCore().getPostReply(id);
if (!reply.isPresent()) {
continue;
}
webInterface.getCore().markReplyKnown(reply.get());
- } else if (type.equals("sone")) {
- Sone sone = webInterface.getCore().getSone(id, false);
- if (sone == null) {
+ } else {
+ Optional<Sone> sone = webInterface.getCore().getSone(id);
+ if (!sone.isPresent()) {