projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert “Sone unlocked” into EventBus-based event.
[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
d6e2750
..
5b27d1b
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 David Roden
+ * Sone - TrustAjaxPage.java - Copyright © 2011
–2012
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
@@
-19,8
+19,8
@@
package net.pterodactylus.sone.web.ajax;
import net.pterodactylus.sone.core.Core;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.core.Core;
import net.pterodactylus.sone.data.Sone;
-import net.pterodactylus.sone.freenet.wot.Trust;
import net.pterodactylus.sone.web.WebInterface;
import net.pterodactylus.sone.web.WebInterface;
+import net.pterodactylus.sone.web.page.FreenetRequest;
import net.pterodactylus.util.json.JsonObject;
/**
import net.pterodactylus.util.json.JsonObject;
/**
@@
-45,7
+45,7
@@
public class TrustAjaxPage extends JsonPage {
* {@inheritDoc}
*/
@Override
* {@inheritDoc}
*/
@Override
- protected JsonObject createJsonObject(Request request) {
+ protected JsonObject createJsonObject(
Freenet
Request request) {
Sone currentSone = getCurrentSone(request.getToadletContext(), false);
if (currentSone == null) {
return createErrorJsonObject("auth-required");
Sone currentSone = getCurrentSone(request.getToadletContext(), false);
if (currentSone == null) {
return createErrorJsonObject("auth-required");
@@
-56,11
+56,7
@@
public class TrustAjaxPage extends JsonPage {
return createErrorJsonObject("invalid-sone-id");
}
webInterface.getCore().trustSone(currentSone, sone);
return createErrorJsonObject("invalid-sone-id");
}
webInterface.getCore().trustSone(currentSone, sone);
- Trust trust = webInterface.getCore().getTrust(currentSone, sone);
- if (trust == null) {
- return createErrorJsonObject("wot-plugin");
- }
- return createSuccessJsonObject().put("trustValue", trust.getExplicit());
+ return createSuccessJsonObject().put("trustValue", webInterface.getCore().getPreferences().getPositiveTrust());
}
}
}
}