*
* 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
import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.TemplateContext;
import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.TemplateContext;
super.processTemplate(request, templateContext);
if (request.getMethod() == Method.POST) {
String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256);
String identity = request.getHttpRequest().getPartAsStringFailsafe("sone", 44);
Sone currentSone = getCurrentSone(request.getToadletContext());
super.processTemplate(request, templateContext);
if (request.getMethod() == Method.POST) {
String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256);
String identity = request.getHttpRequest().getPartAsStringFailsafe("sone", 44);
Sone currentSone = getCurrentSone(request.getToadletContext());
- Sone sone = webInterface.getCore().getSone(identity, false);
- if (sone != null) {
- webInterface.getCore().distrustSone(currentSone, sone);
+ Optional<Sone> sone = webInterface.getCore().getSone(identity);
+ if (sone.isPresent()) {
+ webInterface.getCore().distrustSone(currentSone, sone.get());