projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Notify listeners when a Sone is removed.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
FollowSonePage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java
b/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java
index
9fbca9a
..
9cd1f2a
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/FollowSonePage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/FollowSonePage.java
@@
-20,6
+20,7
@@
package net.pterodactylus.sone.web;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.web.page.Page.Request.Method;
import net.pterodactylus.util.template.Template;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.web.page.Page.Request.Method;
import net.pterodactylus.util.template.Template;
+import net.pterodactylus.util.template.TemplateContext;
/**
* This page lets the user follow another Sone.
/**
* This page lets the user follow another Sone.
@@
-46,17
+47,14
@@
public class FollowSonePage extends SoneTemplatePage {
* {@inheritDoc}
*/
@Override
* {@inheritDoc}
*/
@Override
- protected void processTemplate(Request request, Template
template
) throws RedirectException {
- super.processTemplate(request, template);
+ protected void processTemplate(Request request, Template
Context templateContext
) throws RedirectException {
+ super.processTemplate(request, template
Context
);
if (request.getMethod() == Method.POST) {
String soneId = request.getHttpRequest().getPartAsStringFailsafe("sone", 44);
if (request.getMethod() == Method.POST) {
String soneId = request.getHttpRequest().getPartAsStringFailsafe("sone", 44);
- String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage",
64
);
+ String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage",
256
);
Sone currentSone = getCurrentSone(request.getToadletContext());
Sone currentSone = getCurrentSone(request.getToadletContext());
- Sone sone = webInterface.core().getSone(soneId);
- if (!sone.equals(currentSone)) {
- currentSone.addFriend(sone);
- webInterface.core().saveSone(currentSone);
- }
+ currentSone.addFriend(soneId);
+ webInterface.getCore().saveSone(currentSone);
throw new RedirectException(returnPage);
}
}
throw new RedirectException(returnPage);
}
}