projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Process Sone templates in their own method
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
DismissNotificationPage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/DismissNotificationPage.java
b/src/main/java/net/pterodactylus/sone/web/DismissNotificationPage.java
index
bdbf008
..
f168de1
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/DismissNotificationPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/DismissNotificationPage.java
@@
-1,5
+1,5
@@
/*
/*
- * Sone - DismissNotificationPage.java - Copyright © 2010 David Roden
+ * Sone - DismissNotificationPage.java - Copyright © 2010
–2013
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
@@
-17,8
+17,10
@@
package net.pterodactylus.sone.web;
package net.pterodactylus.sone.web;
+import net.pterodactylus.sone.web.page.FreenetRequest;
import net.pterodactylus.util.notify.Notification;
import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.notify.Notification;
import net.pterodactylus.util.template.Template;
+import net.pterodactylus.util.template.TemplateContext;
/**
* Page that lets the user dismiss a notification.
/**
* Page that lets the user dismiss a notification.
@@
-47,14
+49,13
@@
public class DismissNotificationPage extends SoneTemplatePage {
* {@inheritDoc}
*/
@Override
* {@inheritDoc}
*/
@Override
- protected void processTemplate(Request request, Template template) throws RedirectException {
- super.processTemplate(request, template);
+ protected void processSonePage(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
String notificationId = request.getHttpRequest().getPartAsStringFailsafe("notification", 36);
String notificationId = request.getHttpRequest().getPartAsStringFailsafe("notification", 36);
- Notification notification = webInterface.get
Core().get
Notifications().getNotification(notificationId);
+ Notification notification = webInterface.getNotifications().getNotification(notificationId);
if ((notification != null) && notification.isDismissable()) {
if ((notification != null) && notification.isDismissable()) {
-
webInterface.getCore().getNotifications().removeNotification(notification
);
+
notification.dismiss(
);
}
}
- String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage",
64
);
+ String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage",
256
);
throw new RedirectException(returnPage);
}
throw new RedirectException(returnPage);
}