projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace get likes ajax page with Kotlin version
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
ajax
/
TrustAjaxPage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/ajax/TrustAjaxPage.java
b/src/main/java/net/pterodactylus/sone/web/ajax/TrustAjaxPage.java
index
1c0689f
..
d0247cb
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/ajax/TrustAjaxPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/ajax/TrustAjaxPage.java
@@
-1,5
+1,5
@@
/*
/*
- * Sone - TrustAjaxPage.java - Copyright © 2011–201
5
David Roden
+ * Sone - TrustAjaxPage.java - Copyright © 2011–201
6
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,6
+17,8
@@
package net.pterodactylus.sone.web.ajax;
package net.pterodactylus.sone.web.ajax;
+import javax.annotation.Nonnull;
+
import com.google.common.base.Optional;
import net.pterodactylus.sone.core.Core;
import com.google.common.base.Optional;
import net.pterodactylus.sone.core.Core;
@@
-30,7
+32,7
@@
import net.pterodactylus.sone.web.page.FreenetRequest;
* @see Core#trustSone(Sone, Sone)
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
* @see Core#trustSone(Sone, Sone)
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
-public class TrustAjaxPage extends JsonPage {
+public class TrustAjaxPage extends
LoggedIn
JsonPage {
/**
* Creates a new “trust Sone” AJAX handler.
/**
* Creates a new “trust Sone” AJAX handler.
@@
-45,12
+47,9
@@
public class TrustAjaxPage extends JsonPage {
/**
* {@inheritDoc}
*/
/**
* {@inheritDoc}
*/
+ @Nonnull
@Override
@Override
- protected JsonReturnObject createJsonObject(FreenetRequest request) {
- Sone currentSone = getCurrentSone(request.getToadletContext(), false);
- if (currentSone == null) {
- return createErrorJsonObject("auth-required");
- }
+ protected JsonReturnObject createJsonObject(@Nonnull Sone currentSone, @Nonnull FreenetRequest request) {
String soneId = request.getHttpRequest().getParam("sone");
Optional<Sone> sone = webInterface.getCore().getSone(soneId);
if (!sone.isPresent()) {
String soneId = request.getHttpRequest().getParam("sone");
Optional<Sone> sone = webInterface.getCore().getSone(soneId);
if (!sone.isPresent()) {