- protected void processTemplate(Request request, Template template) throws RedirectException {
- super.processTemplate(request, template);
- String soneId = request.getHttpRequest().getParam("sone");
- Sone currentSone = getCurrentSone(request.getToadletContext());
- Sone sone = webInterface.core().getSone(soneId);
- if (!(sone instanceof SoneShell) && !sone.equals(currentSone)) {
- currentSone.addFriend(sone);
+ protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
+ super.processTemplate(request, templateContext);
+ if (request.getMethod() == Method.POST) {
+ String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256);
+ Sone currentSone = getCurrentSone(request.getToadletContext());
+ String soneIds = request.getHttpRequest().getPartAsStringFailsafe("sone", 1200);
+ for (String soneId : soneIds.split("[ ,]+")) {
+ Optional<Sone> sone = webInterface.getCore().getSone(soneId);
+ if (sone.isPresent()) {
+ webInterface.getCore().followSone(currentSone, soneId);
+ webInterface.getCore().markSoneKnown(sone.get());
+ }
+ }
+ throw new RedirectException(returnPage);