From: David ‘Bombe’ Roden
Date: Fri, 29 Nov 2019 06:04:51 +0000 (+0100)
Subject: 🔀 Merge 'feature/remove-trust-functions' into 'next'
X-Git-Tag: v81^2~17
X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=95f0ee155c205ca5dddbb65f2c180a0a0308d4d3;hp=3335cbf7681220fcf95cff4895e025251211bf8e
🔀 Merge 'feature/remove-trust-functions' into 'next'
---
diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java
index a8d753e..5c1e537 100644
--- a/src/main/java/net/pterodactylus/sone/core/Core.java
+++ b/src/main/java/net/pterodactylus/sone/core/Core.java
@@ -749,75 +749,6 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
}
/**
- * Sets the trust value of the given origin Sone for the target Sone.
- *
- * @param origin
- * The origin Sone
- * @param target
- * The target Sone
- * @param trustValue
- * The trust value (from {@code -100} to {@code 100})
- */
- public void setTrust(Sone origin, Sone target, int trustValue) {
- checkNotNull(origin, "origin must not be null");
- checkArgument(origin.getIdentity() instanceof OwnIdentity, "origin must be a local Sone");
- checkNotNull(target, "target must not be null");
- checkArgument((trustValue >= -100) && (trustValue <= 100), "trustValue must be within [-100, 100]");
- webOfTrustUpdater.setTrust((OwnIdentity) origin.getIdentity(), target.getIdentity(), trustValue, preferences.getTrustComment());
- }
-
- /**
- * Removes any trust assignment for the given target Sone.
- *
- * @param origin
- * The trust origin
- * @param target
- * The trust target
- */
- public void removeTrust(Sone origin, Sone target) {
- checkNotNull(origin, "origin must not be null");
- checkNotNull(target, "target must not be null");
- checkArgument(origin.getIdentity() instanceof OwnIdentity, "origin must be a local Sone");
- webOfTrustUpdater.setTrust((OwnIdentity) origin.getIdentity(), target.getIdentity(), null, null);
- }
-
- /**
- * Assigns the configured positive trust value for the given target.
- *
- * @param origin
- * The trust origin
- * @param target
- * The trust target
- */
- public void trustSone(Sone origin, Sone target) {
- setTrust(origin, target, preferences.getPositiveTrust());
- }
-
- /**
- * Assigns the configured negative trust value for the given target.
- *
- * @param origin
- * The trust origin
- * @param target
- * The trust target
- */
- public void distrustSone(Sone origin, Sone target) {
- setTrust(origin, target, preferences.getNegativeTrust());
- }
-
- /**
- * Removes the trust assignment for the given target.
- *
- * @param origin
- * The trust origin
- * @param target
- * The trust target
- */
- public void untrustSone(Sone origin, Sone target) {
- removeTrust(origin, target);
- }
-
- /**
* Updates the stored Sone with the given Sone.
*
* @param sone
diff --git a/src/main/java/net/pterodactylus/sone/core/PreferencesLoader.java b/src/main/java/net/pterodactylus/sone/core/PreferencesLoader.java
index a730983..5fa33e4 100644
--- a/src/main/java/net/pterodactylus/sone/core/PreferencesLoader.java
+++ b/src/main/java/net/pterodactylus/sone/core/PreferencesLoader.java
@@ -23,9 +23,6 @@ public class PreferencesLoader {
loadCharactersPerPost(configuration);
loadPostCutOffLength(configuration);
loadRequireFullAccess(configuration);
- loadPositiveTrust(configuration);
- loadNegativeTrust(configuration);
- loadTrustComment(configuration);
loadFcpInterfaceActive(configuration);
loadFcpFullAccessRequired(configuration);
}
@@ -69,24 +66,6 @@ public class PreferencesLoader {
.getValue(null));
}
- private void loadPositiveTrust(Configuration configuration) {
- preferences.setNewPositiveTrust(
- configuration.getIntValue("Option/PositiveTrust")
- .getValue(null));
- }
-
- private void loadNegativeTrust(Configuration configuration) {
- preferences.setNewNegativeTrust(
- configuration.getIntValue("Option/NegativeTrust")
- .getValue(null));
- }
-
- private void loadTrustComment(Configuration configuration) {
- preferences.setNewTrustComment(
- configuration.getStringValue("Option/TrustComment")
- .getValue(null));
- }
-
private void loadFcpInterfaceActive(Configuration configuration) {
preferences.setNewFcpInterfaceActive(configuration.getBooleanValue(
"Option/ActivateFcpInterface").getValue(null));
diff --git a/src/main/java/net/pterodactylus/sone/core/WebOfTrustUpdater.java b/src/main/java/net/pterodactylus/sone/core/WebOfTrustUpdater.java
index 35c3203..95d066d 100644
--- a/src/main/java/net/pterodactylus/sone/core/WebOfTrustUpdater.java
+++ b/src/main/java/net/pterodactylus/sone/core/WebOfTrustUpdater.java
@@ -1,6 +1,5 @@
package net.pterodactylus.sone.core;
-import net.pterodactylus.sone.freenet.wot.Identity;
import net.pterodactylus.sone.freenet.wot.OwnIdentity;
import net.pterodactylus.util.service.Service;
@@ -12,7 +11,6 @@ import com.google.inject.ImplementedBy;
@ImplementedBy(WebOfTrustUpdaterImpl.class)
public interface WebOfTrustUpdater extends Service {
- void setTrust(OwnIdentity truster, Identity trustee, Integer score, String comment);
boolean addContextWait(OwnIdentity ownIdentity, String context);
void removeContext(OwnIdentity ownIdentity, String context);
void setProperty(OwnIdentity ownIdentity, String propertyName, String propertyValue);
diff --git a/src/main/java/net/pterodactylus/sone/core/WebOfTrustUpdaterImpl.java b/src/main/java/net/pterodactylus/sone/core/WebOfTrustUpdaterImpl.java
index 809ca20..d0da223 100644
--- a/src/main/java/net/pterodactylus/sone/core/WebOfTrustUpdaterImpl.java
+++ b/src/main/java/net/pterodactylus/sone/core/WebOfTrustUpdaterImpl.java
@@ -26,11 +26,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import net.pterodactylus.sone.freenet.plugin.PluginException;
-import net.pterodactylus.sone.freenet.wot.Identity;
import net.pterodactylus.sone.freenet.wot.OwnIdentity;
-import net.pterodactylus.sone.freenet.wot.Trust;
import net.pterodactylus.sone.freenet.wot.WebOfTrustConnector;
-import net.pterodactylus.sone.freenet.wot.WebOfTrustException;
import net.pterodactylus.util.service.AbstractService;
import com.google.common.annotations.VisibleForTesting;
@@ -74,34 +71,6 @@ public class WebOfTrustUpdaterImpl extends AbstractService implements WebOfTrust
//
/**
- * Updates the trust relation between the truster and the trustee. This method
- * will return immediately and perform a trust update in the background.
- *
- * @param truster
- * The identity giving the trust
- * @param trustee
- * The identity receiving the trust
- * @param score
- * The new level of trust (from -100 to 100, may be {@code null} to remove
- * the trust completely)
- * @param comment
- * The comment of the trust relation
- */
- @Override
- public void setTrust(OwnIdentity truster, Identity trustee, Integer score, String comment) {
- SetTrustJob setTrustJob = new SetTrustJob(truster, trustee, score, comment);
- if (updateJobs.contains(setTrustJob)) {
- updateJobs.remove(setTrustJob);
- }
- logger.log(Level.FINER, "Adding Trust Update Job: " + setTrustJob);
- try {
- updateJobs.put(setTrustJob);
- } catch (InterruptedException e) {
- /* the queue is unbounded so it should never block. */
- }
- }
-
- /**
* Adds the given context to the given own identity, waiting for completion of
* the operation.
*
@@ -297,91 +266,6 @@ public class WebOfTrustUpdaterImpl extends AbstractService implements WebOfTrust
}
/**
- * Update job that sets the trust relation between two identities.
- */
- @VisibleForTesting
- class SetTrustJob extends WebOfTrustUpdateJob {
-
- /** The identity giving the trust. */
- private final OwnIdentity truster;
-
- /** The identity receiving the trust. */
- private final Identity trustee;
-
- /** The score of the relation. */
- private final Integer score;
-
- /** The comment of the relation. */
- private final String comment;
-
- /**
- * Creates a new set trust job.
- *
- * @param truster
- * The identity giving the trust
- * @param trustee
- * The identity receiving the trust
- * @param score
- * The score of the trust (from -100 to 100, may be {@code null} to remote
- * the trust relation completely)
- * @param comment
- * The comment of the trust relation
- */
- public SetTrustJob(OwnIdentity truster, Identity trustee, Integer score, String comment) {
- this.truster = checkNotNull(truster, "truster must not be null");
- this.trustee = checkNotNull(trustee, "trustee must not be null");
- this.score = score;
- this.comment = comment;
- }
-
- /** {@inheritDoc} */
- @Override
- @SuppressWarnings("synthetic-access")
- public void run() {
- try {
- if (score != null) {
- webOfTrustConnector.setTrust(truster, trustee, score, comment);
- trustee.setTrust(truster, new Trust(score, null, 0));
- } else {
- webOfTrustConnector.removeTrust(truster, trustee);
- trustee.removeTrust(truster);
- }
- finish(true);
- } catch (WebOfTrustException wote1) {
- logger.log(Level.WARNING, "Could not set Trust value for " + truster + " -> " + trustee + " to " + score + " (" + comment + ")!", wote1);
- finish(false);
- }
- }
-
- //
- // OBJECT METHODS
- //
-
- /** {@inheritDoc} */
- @Override
- public boolean equals(Object object) {
- if ((object == null) || !object.getClass().equals(getClass())) {
- return false;
- }
- SetTrustJob updateJob = (SetTrustJob) object;
- return updateJob.truster.equals(truster) && updateJob.trustee.equals(trustee);
- }
-
- /** {@inheritDoc} */
- @Override
- public int hashCode() {
- return getClass().hashCode() ^ truster.hashCode() ^ trustee.hashCode();
- }
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return String.format("%s[truster=%s,trustee=%s]", getClass().getSimpleName(), truster.getId(), trustee.getId());
- }
-
- }
-
- /**
* Base class for context updates of an {@link OwnIdentity}.
*/
@VisibleForTesting
diff --git a/src/main/java/net/pterodactylus/sone/web/AllPages.kt b/src/main/java/net/pterodactylus/sone/web/AllPages.kt
index 9eccccf..c538f0e 100644
--- a/src/main/java/net/pterodactylus/sone/web/AllPages.kt
+++ b/src/main/java/net/pterodactylus/sone/web/AllPages.kt
@@ -23,7 +23,6 @@ class AllPages {
@Inject lateinit var deleteReplyPage: DeleteReplyPage
@Inject lateinit var deleteSonePage: DeleteSonePage
@Inject lateinit var dismissNotificationPage: DismissNotificationPage
- @Inject lateinit var distrustPage: DistrustPage
@Inject lateinit var editAlbumPage: EditAlbumPage
@Inject lateinit var editImagePage: EditImagePage
@Inject lateinit var editProfileFieldPage: EditProfileFieldPage
@@ -42,12 +41,10 @@ class AllPages {
@Inject lateinit var optionsPage: OptionsPage
@Inject lateinit var rescuePage: RescuePage
@Inject lateinit var searchPage: SearchPage
- @Inject lateinit var trustPage: TrustPage
@Inject lateinit var unbookmarkPage: UnbookmarkPage
@Inject lateinit var unfollowSonePage: UnfollowSonePage
@Inject lateinit var unlikePage: UnlikePage
@Inject lateinit var unlockSonePage: UnlockSonePage
- @Inject lateinit var untrustPage: UntrustPage
@Inject lateinit var uploadImagePage: UploadImagePage
@Inject lateinit var viewPostPage: ViewPostPage
@Inject lateinit var viewSonePage: ViewSonePage
diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java
index 588ffb7..e31d9a8 100644
--- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java
+++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java
@@ -69,7 +69,6 @@ import net.pterodactylus.sone.web.ajax.DeletePostAjaxPage;
import net.pterodactylus.sone.web.ajax.DeleteProfileFieldAjaxPage;
import net.pterodactylus.sone.web.ajax.DeleteReplyAjaxPage;
import net.pterodactylus.sone.web.ajax.DismissNotificationAjaxPage;
-import net.pterodactylus.sone.web.ajax.DistrustAjaxPage;
import net.pterodactylus.sone.web.ajax.EditAlbumAjaxPage;
import net.pterodactylus.sone.web.ajax.EditImageAjaxPage;
import net.pterodactylus.sone.web.ajax.EditProfileFieldAjaxPage;
@@ -86,12 +85,10 @@ import net.pterodactylus.sone.web.ajax.LikeAjaxPage;
import net.pterodactylus.sone.web.ajax.LockSoneAjaxPage;
import net.pterodactylus.sone.web.ajax.MarkAsKnownAjaxPage;
import net.pterodactylus.sone.web.ajax.MoveProfileFieldAjaxPage;
-import net.pterodactylus.sone.web.ajax.TrustAjaxPage;
import net.pterodactylus.sone.web.ajax.UnbookmarkAjaxPage;
import net.pterodactylus.sone.web.ajax.UnfollowSoneAjaxPage;
import net.pterodactylus.sone.web.ajax.UnlikeAjaxPage;
import net.pterodactylus.sone.web.ajax.UnlockSoneAjaxPage;
-import net.pterodactylus.sone.web.ajax.UntrustAjaxPage;
import net.pterodactylus.sone.web.page.FreenetRequest;
import net.pterodactylus.sone.web.page.TemplateRenderer;
import net.pterodactylus.sone.web.pages.*;
@@ -574,9 +571,6 @@ public class WebInterface implements SessionProvider {
pageToadletRegistry.addPage(new UploadImagePage(this, loaders, templateRenderer));
pageToadletRegistry.addPage(new EditImagePage(this, loaders, templateRenderer));
pageToadletRegistry.addPage(new DeleteImagePage(this, loaders, templateRenderer));
- pageToadletRegistry.addPage(new TrustPage(this, loaders, templateRenderer));
- pageToadletRegistry.addPage(new DistrustPage(this, loaders, templateRenderer));
- pageToadletRegistry.addPage(new UntrustPage(this, loaders, templateRenderer));
pageToadletRegistry.addPage(new MarkAsKnownPage(this, loaders, templateRenderer));
pageToadletRegistry.addPage(new BookmarkPage(this, loaders, templateRenderer));
pageToadletRegistry.addPage(new UnbookmarkPage(this, loaders, templateRenderer));
@@ -619,9 +613,6 @@ public class WebInterface implements SessionProvider {
pageToadletRegistry.addPage(new UnfollowSoneAjaxPage(this));
pageToadletRegistry.addPage(new EditAlbumAjaxPage(this));
pageToadletRegistry.addPage(new EditImageAjaxPage(this, parserFilter, shortenFilter, renderFilter));
- pageToadletRegistry.addPage(new TrustAjaxPage(this));
- pageToadletRegistry.addPage(new DistrustAjaxPage(this));
- pageToadletRegistry.addPage(new UntrustAjaxPage(this));
pageToadletRegistry.addPage(new LikeAjaxPage(this));
pageToadletRegistry.addPage(new UnlikeAjaxPage(this));
pageToadletRegistry.addPage(new GetLikesAjaxPage(this));
diff --git a/src/main/kotlin/net/pterodactylus/sone/core/Preferences.kt b/src/main/kotlin/net/pterodactylus/sone/core/Preferences.kt
index 783552e..7363ed0 100644
--- a/src/main/kotlin/net/pterodactylus/sone/core/Preferences.kt
+++ b/src/main/kotlin/net/pterodactylus/sone/core/Preferences.kt
@@ -77,24 +77,6 @@ class Preferences(private val eventBus: EventBus) {
get() = unsupported
set(value) = _requireFullAccess.set(value)
- private val _positiveTrust = DefaultOption(75, range(0, 100))
- val positiveTrust: Int get() = _positiveTrust.get()
- var newPositiveTrust: Int?
- get() = unsupported
- set(value) = _positiveTrust.set(value)
-
- private val _negativeTrust = DefaultOption(-25, range(-100, 100))
- val negativeTrust: Int get() = _negativeTrust.get()
- var newNegativeTrust: Int?
- get() = unsupported
- set(value) = _negativeTrust.set(value)
-
- private val _trustComment = DefaultOption("Set from Sone Web Interface")
- val trustComment: String get() = _trustComment.get()
- var newTrustComment: String?
- get() = unsupported
- set(value) = _trustComment.set(value)
-
private val _fcpInterfaceActive = DefaultOption(false)
val fcpInterfaceActive: Boolean get() = _fcpInterfaceActive.get()
var newFcpInterfaceActive: Boolean?
@@ -125,9 +107,6 @@ class Preferences(private val eventBus: EventBus) {
configuration.getIntValue("Option/CharactersPerPost").value = _charactersPerPost.real
configuration.getIntValue("Option/PostCutOffLength").value = _postCutOffLength.real
configuration.getBooleanValue("Option/RequireFullAccess").value = _requireFullAccess.real
- configuration.getIntValue("Option/PositiveTrust").value = _positiveTrust.real
- configuration.getIntValue("Option/NegativeTrust").value = _negativeTrust.real
- configuration.getStringValue("Option/TrustComment").value = _trustComment.real
configuration.getBooleanValue("Option/ActivateFcpInterface").value = _fcpInterfaceActive.real
configuration.getIntValue("Option/FcpFullAccessRequired").value = toInt(_fcpFullAccessRequired.real)
}
diff --git a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/PluginWebOfTrustConnector.kt b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/PluginWebOfTrustConnector.kt
index fae90ae..a8c40a6 100644
--- a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/PluginWebOfTrustConnector.kt
+++ b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/PluginWebOfTrustConnector.kt
@@ -64,19 +64,6 @@ class PluginWebOfTrustConnector @Inject constructor(private val pluginConnector:
performRequest(SimpleFieldSetBuilder().put("Message", "RemoveProperty").put("Identity", ownIdentity.id).put("Property", name).get())
}
- override fun getTrust(ownIdentity: OwnIdentity, identity: Identity) =
- performRequest(SimpleFieldSetBuilder().put("Message", "GetIdentity").put("Truster", ownIdentity.id).put("Identity", identity.id).get())
- .fields
- .parseTrust()
-
- override fun setTrust(ownIdentity: OwnIdentity, identity: Identity, trust: Int, comment: String) {
- performRequest(SimpleFieldSetBuilder().put("Message", "SetTrust").put("Truster", ownIdentity.id).put("Trustee", identity.id).put("Value", trust.toString()).put("Comment", comment).get())
- }
-
- override fun removeTrust(ownIdentity: OwnIdentity, identity: Identity) {
- performRequest(SimpleFieldSetBuilder().put("Message", "RemoveTrust").put("Truster", ownIdentity.id).put("Trustee", identity.id).get())
- }
-
override fun ping() {
performRequest(SimpleFieldSetBuilder().put("Message", "Ping").get())
}
diff --git a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.kt b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.kt
index 8488f16..e31dce6 100644
--- a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.kt
+++ b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.kt
@@ -70,41 +70,6 @@ interface WebOfTrustConnector {
fun removeProperty(ownIdentity: OwnIdentity, name: String)
/**
- * Returns the trust for the given identity assigned to it by the given own
- * identity.
- *
- * @param ownIdentity The own identity
- * @param identity The identity to get the trust for
- * @return The trust for the given identity
- * @throws PluginException if an error occured talking to the Web of Trust plugin
- */
- @Throws(PluginException::class)
- fun getTrust(ownIdentity: OwnIdentity, identity: Identity): Trust
-
- /**
- * Sets the trust for the given identity.
- *
- * @param ownIdentity The trusting identity
- * @param identity The trusted identity
- * @param trust The amount of trust (-100 thru 100)
- * @param comment The comment or explanation of the trust value
- * @throws PluginException if an error occured talking to the Web of Trust plugin
- */
- @Throws(PluginException::class)
- fun setTrust(ownIdentity: OwnIdentity, identity: Identity, trust: Int, comment: String)
-
- /**
- * Removes any trust assignment of the given own identity for the given
- * identity.
- *
- * @param ownIdentity The own identity
- * @param identity The identity to remove all trust for
- * @throws WebOfTrustException if an error occurs
- */
- @Throws(WebOfTrustException::class)
- fun removeTrust(ownIdentity: OwnIdentity, identity: Identity)
-
- /**
* Pings the Web of Trust plugin. If the plugin can not be reached, a
* [PluginException] is thrown.
*
diff --git a/src/main/kotlin/net/pterodactylus/sone/web/ajax/DistrustAjaxPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/ajax/DistrustAjaxPage.kt
deleted file mode 100644
index cbeed6e..0000000
--- a/src/main/kotlin/net/pterodactylus/sone/web/ajax/DistrustAjaxPage.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-package net.pterodactylus.sone.web.ajax
-
-import net.pterodactylus.sone.core.*
-import net.pterodactylus.sone.data.*
-import net.pterodactylus.sone.utils.*
-import net.pterodactylus.sone.web.*
-import net.pterodactylus.sone.web.page.*
-import javax.inject.*
-
-/**
- * AJAX page that lets the user distrust a Sone.
- *
- * @see Core.distrustSone(Sone, Sone)
- */
-@ToadletPath("distrustSone.ajax")
-class DistrustAjaxPage @Inject constructor(webInterface: WebInterface) : LoggedInJsonPage(webInterface) {
-
- override fun createJsonObject(currentSone: Sone, request: FreenetRequest) =
- request.parameters["sone"]
- ?.let(core::getSone)
- ?.let { sone ->
- createSuccessJsonObject()
- .put("trustValue", core.preferences.negativeTrust)
- .also {
- core.distrustSone(currentSone, sone)
- }
- } ?: createErrorJsonObject("invalid-sone-id")
-
-}
diff --git a/src/main/kotlin/net/pterodactylus/sone/web/ajax/TrustAjaxPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/ajax/TrustAjaxPage.kt
deleted file mode 100644
index 9f0de87..0000000
--- a/src/main/kotlin/net/pterodactylus/sone/web/ajax/TrustAjaxPage.kt
+++ /dev/null
@@ -1,24 +0,0 @@
-package net.pterodactylus.sone.web.ajax
-
-import net.pterodactylus.sone.data.*
-import net.pterodactylus.sone.utils.*
-import net.pterodactylus.sone.web.*
-import net.pterodactylus.sone.web.page.*
-import javax.inject.*
-
-/**
- * AJAX page that lets the user trust a Sone.
- *
- * @see net.pterodactylus.sone.core.Core.trustSone
- */
-@ToadletPath("trustSone.ajax")
-class TrustAjaxPage @Inject constructor(webInterface: WebInterface) : LoggedInJsonPage(webInterface) {
-
- override fun createJsonObject(currentSone: Sone, request: FreenetRequest) =
- request.parameters["sone"]
- ?.let(core::getSone)
- ?.let { core.trustSone(currentSone, it) }
- ?.let { createSuccessJsonObject().put("trustValue", core.preferences.positiveTrust) }
- ?: createErrorJsonObject("invalid-sone-id")
-
-}
diff --git a/src/main/kotlin/net/pterodactylus/sone/web/ajax/UntrustAjaxPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/ajax/UntrustAjaxPage.kt
deleted file mode 100644
index e4b5edb..0000000
--- a/src/main/kotlin/net/pterodactylus/sone/web/ajax/UntrustAjaxPage.kt
+++ /dev/null
@@ -1,22 +0,0 @@
-package net.pterodactylus.sone.web.ajax
-
-import net.pterodactylus.sone.data.Sone
-import net.pterodactylus.sone.utils.parameters
-import net.pterodactylus.sone.web.WebInterface
-import net.pterodactylus.sone.web.page.*
-import javax.inject.Inject
-
-/**
- * AJAX page that lets the user [untrust][net.pterodactylus.sone.core.Core.untrustSone] a [Sone].
- */
-@ToadletPath("untrustSone.ajax")
-class UntrustAjaxPage @Inject constructor(webInterface: WebInterface) : LoggedInJsonPage(webInterface) {
-
- override fun createJsonObject(currentSone: Sone, request: FreenetRequest) =
- request.parameters["sone"]
- ?.let(core::getSone)
- ?.also { core.untrustSone(currentSone, it) }
- ?.let { createSuccessJsonObject() }
- ?: createErrorJsonObject("invalid-sone-id")
-
-}
diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/DistrustPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/DistrustPage.kt
deleted file mode 100644
index dd3ad8c..0000000
--- a/src/main/kotlin/net/pterodactylus/sone/web/pages/DistrustPage.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-package net.pterodactylus.sone.web.pages
-
-import net.pterodactylus.sone.data.*
-import net.pterodactylus.sone.main.*
-import net.pterodactylus.sone.utils.*
-import net.pterodactylus.sone.web.*
-import net.pterodactylus.sone.web.page.*
-import net.pterodactylus.util.template.*
-import javax.inject.*
-
-/**
- * Page that lets the user distrust another Sone. This will assign a
- * configurable (negative) amount of trust to an identity.
- *
- * @see net.pterodactylus.sone.core.Core#distrustSone(Sone, Sone)
- */
-@ToadletPath("distrust.html")
-class DistrustPage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) :
- LoggedInPage("Page.Distrust.Title", webInterface, loaders, templateRenderer) {
-
- override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) {
- if (soneRequest.isPOST) {
- soneRequest.core.getSone(soneRequest.httpRequest.getPartAsStringFailsafe("sone", 44))
- ?.run { soneRequest.core.distrustSone(currentSone, this) }
- redirectTo(soneRequest.httpRequest.getPartAsStringFailsafe("returnPage", 256))
- }
- }
-
-}
diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/OptionsPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/OptionsPage.kt
index 2c454e8..412258d 100644
--- a/src/main/kotlin/net/pterodactylus/sone/web/pages/OptionsPage.kt
+++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/OptionsPage.kt
@@ -50,9 +50,6 @@ class OptionsPage @Inject constructor(webInterface: WebInterface, loaders: Loade
val imagesPerPage = soneRequest.parameters["images-per-page"]?.toIntOrNull()
val insertionDelay = soneRequest.parameters["insertion-delay"]?.toIntOrNull()
val fcpFullAccessRequired = soneRequest.parameters["fcp-full-access-required"]?.toIntOrNull()
- val negativeTrust = soneRequest.parameters["negative-trust"]?.toIntOrNull()
- val positiveTrust = soneRequest.parameters["positive-trust"]?.toIntOrNull()
- val trustComment = soneRequest.parameters["trust-comment"]?.emptyToNull
if (cantSetOption { soneRequest.core.preferences.newPostsPerPage = postsPerPage }) fieldsWithErrors += "posts-per-page"
if (cantSetOption { soneRequest.core.preferences.newCharactersPerPost = charactersPerPost }) fieldsWithErrors += "characters-per-post"
@@ -60,9 +57,6 @@ class OptionsPage @Inject constructor(webInterface: WebInterface, loaders: Loade
if (cantSetOption { soneRequest.core.preferences.newImagesPerPage = imagesPerPage }) fieldsWithErrors += "images-per-page"
if (cantSetOption { soneRequest.core.preferences.newInsertionDelay = insertionDelay }) fieldsWithErrors += "insertion-delay"
fcpFullAccessRequired?.also { if (cantSetOption { soneRequest.core.preferences.newFcpFullAccessRequired = FullAccessRequired.values()[fcpFullAccessRequired] }) fieldsWithErrors += "fcp-full-access-required" }
- if (cantSetOption { soneRequest.core.preferences.newNegativeTrust = negativeTrust }) fieldsWithErrors += "negative-trust"
- if (cantSetOption { soneRequest.core.preferences.newPositiveTrust = positiveTrust }) fieldsWithErrors += "positive-trust"
- if (cantSetOption { soneRequest.core.preferences.newTrustComment = trustComment }) fieldsWithErrors += "trust-comment"
if (fieldsWithErrors.isEmpty()) {
soneRequest.core.touchConfiguration()
@@ -86,11 +80,8 @@ class OptionsPage @Inject constructor(webInterface: WebInterface, loaders: Loade
templateContext["images-per-page"] = preferences.imagesPerPage
templateContext["fcp-interface-active"] = preferences.fcpInterfaceActive
templateContext["require-full-access"] = preferences.requireFullAccess
- templateContext["negative-trust"] = preferences.negativeTrust
- templateContext["positive-trust"] = preferences.positiveTrust
templateContext["post-cut-off-length"] = preferences.postCutOffLength
templateContext["posts-per-page"] = preferences.postsPerPage
- templateContext["trust-comment"] = preferences.trustComment
}
}
diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/TrustPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/TrustPage.kt
deleted file mode 100644
index 54edc5d..0000000
--- a/src/main/kotlin/net/pterodactylus/sone/web/pages/TrustPage.kt
+++ /dev/null
@@ -1,28 +0,0 @@
-package net.pterodactylus.sone.web.pages
-
-import net.pterodactylus.sone.data.*
-import net.pterodactylus.sone.main.*
-import net.pterodactylus.sone.utils.*
-import net.pterodactylus.sone.web.*
-import net.pterodactylus.sone.web.page.*
-import net.pterodactylus.util.template.*
-import javax.inject.*
-
-/**
- * Page that lets the user trust another Sone. This will assign a configurable
- * amount of trust to an identity.
- */
-@ToadletPath("trust.html")
-class TrustPage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) :
- LoggedInPage("Page.Trust.Title", webInterface, loaders, templateRenderer) {
-
- override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) {
- if (soneRequest.isPOST) {
- soneRequest.core.getSone(soneRequest.parameters["sone"]!!)?.let { sone ->
- soneRequest.core.trustSone(currentSone, sone)
- }
- redirectTo(soneRequest.parameters["returnPage", 256])
- }
- }
-
-}
diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/UntrustPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/UntrustPage.kt
deleted file mode 100644
index dd445c8..0000000
--- a/src/main/kotlin/net/pterodactylus/sone/web/pages/UntrustPage.kt
+++ /dev/null
@@ -1,28 +0,0 @@
-package net.pterodactylus.sone.web.pages
-
-import net.pterodactylus.sone.data.*
-import net.pterodactylus.sone.main.*
-import net.pterodactylus.sone.utils.*
-import net.pterodactylus.sone.web.*
-import net.pterodactylus.sone.web.page.*
-import net.pterodactylus.util.template.*
-import javax.inject.*
-
-/**
- * Page that lets the user untrust another Sone. This will remove all trust
- * assignments for an identity.
- */
-@ToadletPath("untrust.html")
-class UntrustPage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) :
- LoggedInPage("Page.Untrust.Title", webInterface, loaders, templateRenderer) {
-
- override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) {
- if (soneRequest.isPOST) {
- soneRequest.parameters["sone", 44]!!
- .let(soneRequest.core::getSone)
- ?.also { soneRequest.core.untrustSone(currentSone, it) }
- redirectTo(soneRequest.parameters["returnPage", 256])
- }
- }
-
-}
diff --git a/src/main/resources/i18n/sone.de.properties b/src/main/resources/i18n/sone.de.properties
index a3a95d6..a2ff8b1 100644
--- a/src/main/resources/i18n/sone.de.properties
+++ b/src/main/resources/i18n/sone.de.properties
@@ -66,10 +66,6 @@ Page.Options.Option.ImagesPerPage.Description=Anzahl der Bilder pro Seite.
Page.Options.Option.CharactersPerPost.Description=Die Anzahl der Zeichen, die eine Nachricht enthalten muss, damit sie gekürzt angezeigt wird (-1 für ânie kürzenâ). Die Anzahl der tatsächlich angezeigten Zeichen wird in der nächsten Option konfiguriert.
Page.Options.Option.PostCutOffLength.Description=Die Anzahl der Zeichen, die von einer gekürzten Nachricht sichtbar sind (siehe Option hierüber). Wird ignoriert, wenn die Option hierüber deaktiviert ist, bzw. auf -1 steht.
Page.Options.Option.RequireFullAccess.Description=Zugriff auf Sone für alle Rechner, die keinen vollen Zugriff haben, unterbinden.
-Page.Options.Section.TrustOptions.Title=Vertrauenseinstellungen
-Page.Options.Option.PositiveTrust.Description=Die Menge an positivem Vertrauen, die bei einem Klick auf den Haken unter einer Nachricht zugewiesen werden soll.
-Page.Options.Option.NegativeTrust.Description=Die Menge an negativem Vertrauen, die bei einem Klick auf das rote X unter einer Nachricht zugewiesen werden soll. Dieser Wert sollte negativ sein.
-Page.Options.Option.TrustComment.Description=Der Kommentar, der im Web of Trust für Ihre Zuweisung angezeigt werden soll.
Page.Options.Section.FcpOptions.Title=FCP-Schnittstellenoptionen
Page.Options.Option.FcpInterfaceActive.Description=Die FCP-Schnittstelle aktivieren, um anderen Plugins und Programmen den Zugriff auf Ihr Sone-Plugin zu ermöglichen.
Page.Options.Option.FcpFullAccessRequired.Description=FCP-Verbindungen nur von âerlaubten Hostsâ erlauben (siehe {link}Knoten-Konfiguration, Abschnitt âFCPâ{/link}).
@@ -276,12 +272,6 @@ Page.DeleteAlbum.Text.AlbumWillBeGone=Ihr Album â{title}â wird gelöscht. M
Page.DeleteAlbum.Button.Yes=Ja, Album löschen.
Page.DeleteAlbum.Button.No=Nein, Album nicht löschen.
-Page.Trust.Title=Sone vertrauen - Sone
-
-Page.Distrust.Title=Sone misstrauen - Sone
-
-Page.Untrust.Title=Sone nicht vertrauen - Sone
-
Page.MarkAsKnown.Title=Als gelesen markieren - Sone
Page.Bookmark.Title=Als Favorit markieren - Sone
@@ -364,9 +354,10 @@ View.Sone.Status.Downloading=Diese Sone wird gerade herunter geladen.
View.Sone.Status.Inserting=Diese Sone wird gerade hoch geladen.
View.SoneMenu.Link.AllAlbums=alle Alben
+View.SoneMenu.WebOfTrustLink=âWeb of Trustâ Profil
View.Post.UnknownAuthor=(unbekannt)
-View.Post.WebOfTrustLink=âWeb of Trustâ Profil
+View.Post.WebOfTrustLink=WoT-Profil
View.Post.Permalink=Nachrichtenlink
View.Post.PermalinkAuthor=Autorenlink
View.Post.Bookmarks.PostIsBookmarked=Nachricht ist ein Favorit, klicken, um Favoritenmarkierung zu entfernen
@@ -383,10 +374,6 @@ View.Post.ShowLess=weniger zeigen
View.UpdateStatus.Text.ChooseSenderIdentity=Absender wählen
-View.Trust.Tooltip.Trust=Dieser Sone vertrauen
-View.Trust.Tooltip.Distrust=Dieser Sone misstrauen
-View.Trust.Tooltip.Untrust=Dieser Sone kein Vertrauen zuweisen
-
View.CreateAlbum.Title=Album anlegen
View.CreateAlbum.Label.Name=Name:
View.CreateAlbum.Label.Description=Beschreibung:
@@ -437,9 +424,6 @@ WebInterface.DefaultText.Option.PostsPerPage=Anzahl der Nachrichten pro Seite
WebInterface.DefaultText.Option.ImagesPerPage=Anzahl der Bilder pro Seite
WebInterface.DefaultText.Option.CharactersPerPost=Anzahl der Zeichen, die eine Nachricht haben muss, damit er gekürzt wird
WebInterface.DefaultText.Option.PostCutOffLength=Anzahl der Zeichen, die von einer gekürzten Nachricht angezeigt werden
-WebInterface.DefaultText.Option.PositiveTrust=Der positive Vertrauenswert
-WebInterface.DefaultText.Option.NegativeTrust=Der negative Vertrauenswert
-WebInterface.DefaultText.Option.TrustComment=Der Kommentar für die Vertrauenszuweisung
WebInterface.Button.Comment=Antworten
WebInterface.Confirmation.DeletePostButton=Ja, löschen!
WebInterface.Confirmation.DeleteReplyButton=Ja, löschen!
diff --git a/src/main/resources/i18n/sone.en.properties b/src/main/resources/i18n/sone.en.properties
index a23730c..c599f84 100644
--- a/src/main/resources/i18n/sone.en.properties
+++ b/src/main/resources/i18n/sone.en.properties
@@ -68,10 +68,6 @@ Page.Options.Option.ImagesPerPage.Description=The number of images to display on
Page.Options.Option.CharactersPerPost.Description=The number of characters to display from a post before cutting it off and showing a link to expand it (-1 to disable). The actual length of the snippet is determined by the option below.
Page.Options.Option.PostCutOffLength.Description=The number of characters that are displayed if a post is deemed too long (see option above). Ignored if ânumber of characters to displayâ is disabled (set to -1).
Page.Options.Option.RequireFullAccess.Description=Whether to deny access to Sone to any host that has not been granted full access.
-Page.Options.Section.TrustOptions.Title=Trust Settings
-Page.Options.Option.PositiveTrust.Description=The amount of positive trust you want to assign to other Sones by clicking the checkmark below a post or reply.
-Page.Options.Option.NegativeTrust.Description=The amount of trust you want to assign to other Sones by clicking the red X below a post or reply. This value should be negative.
-Page.Options.Option.TrustComment.Description=The comment that will be set in the web of trust for any trust you assign from Sone.
Page.Options.Section.FcpOptions.Title=FCP Interface Settings
Page.Options.Option.FcpInterfaceActive.Description=Activate the FCP interface to allow other plugins and remote clients to access your Sone plugin.
Page.Options.Option.FcpFullAccessRequired.Description=Require FCP connection from allowed hosts (see your {link}nodeâs configuration, section âFCPâ{/link})
@@ -278,12 +274,6 @@ Page.DeleteAlbum.Text.AlbumWillBeGone=This will remove your album â{title}â.
Page.DeleteAlbum.Button.Yes=Yes, delete album.
Page.DeleteAlbum.Button.No=No, donât delete album.
-Page.Trust.Title=Trust Sone - Sone
-
-Page.Distrust.Title=Distrust Sone - Sone
-
-Page.Untrust.Title=Untrust Sone - Sone
-
Page.MarkAsKnown.Title=Mark as Known - Sone
Page.Bookmark.Title=Bookmark - Sone
@@ -366,9 +356,10 @@ View.Sone.Status.Downloading=This Sone is currently being downloaded.
View.Sone.Status.Inserting=This Sone is currently being inserted.
View.SoneMenu.Link.AllAlbums=all albums
+View.SoneMenu.WebOfTrustLink=web of trust profile
View.Post.UnknownAuthor=(unknown)
-View.Post.WebOfTrustLink=web of trust profile
+View.Post.WebOfTrustLink=WoT Profile
View.Post.Permalink=link post
View.Post.PermalinkAuthor=link author
View.Post.Bookmarks.PostIsBookmarked=Post is bookmarked, click to remove from bookmarks
@@ -385,10 +376,6 @@ View.Post.ShowLess=show less
View.UpdateStatus.Text.ChooseSenderIdentity=Choose the sender identity
-View.Trust.Tooltip.Trust=Trust this person
-View.Trust.Tooltip.Distrust=Assign negative trust to this person
-View.Trust.Tooltip.Untrust=Remove your trust assignment for this person
-
View.CreateAlbum.Title=Create Album
View.CreateAlbum.Label.Name=Name:
View.CreateAlbum.Label.Description=Description:
@@ -439,9 +426,6 @@ WebInterface.DefaultText.Option.PostsPerPage=Number of posts to show on a page
WebInterface.DefaultText.Option.ImagesPerPage=Number of images to show on a page
WebInterface.DefaultText.Option.CharactersPerPost=Number of characters a post must have to be shortened
WebInterface.DefaultText.Option.PostCutOffLength=Number of characters for the snippet of the shortened post
-WebInterface.DefaultText.Option.PositiveTrust=The positive trust to assign
-WebInterface.DefaultText.Option.NegativeTrust=The negative trust to assign
-WebInterface.DefaultText.Option.TrustComment=The comment to set in the web of trust
WebInterface.Button.Comment=Comment
WebInterface.Confirmation.DeletePostButton=Yes, delete!
WebInterface.Confirmation.DeleteReplyButton=Yes, delete!
diff --git a/src/main/resources/i18n/sone.es.properties b/src/main/resources/i18n/sone.es.properties
index 8a6e200..3a67a59 100644
--- a/src/main/resources/i18n/sone.es.properties
+++ b/src/main/resources/i18n/sone.es.properties
@@ -66,10 +66,6 @@ Page.Options.Option.ImagesPerPage.Description=Número de imágenes a mostrar en
Page.Options.Option.CharactersPerPost.Description=Número de carácteres a mostrar de una publicación antes de acortarla y mostrar un link para expandirla (-1 para deshabilitar esta opción). La longitud de la acortación está determinada por la siguiente opción.
Page.Options.Option.PostCutOffLength.Description=Número de carácteres que son mostrados si una publicación es demasiado larga (Mirar la opción anterior).Ignoralo si "Número de carácteres a mostrar" está desactivado (Valor en -1).
Page.Options.Option.RequireFullAccess.Description=Denegar el acceso a Sone a cualquier host al que no se haya garantizado acceso completo.
-Page.Options.Section.TrustOptions.Title=Opciones de veracidad.
-Page.Options.Option.PositiveTrust.Description=Cantidad de veracidad positiva que quieres asignar a otros Sone al clicar en el tick tras una publicación o respuesta.
-Page.Options.Option.NegativeTrust.Description=Cantidad de veracidad que quieres asignar a otros Sone al clicar la X roja tras una publicación o respuesta. Este valor deberÃa ser negativo.
-Page.Options.Option.TrustComment.Description=El comentario que se mostrara en la Web of Trust para cualquier veracidad que asignes desde Sone.
Page.Options.Section.FcpOptions.Title=Opciones de la interfaz FCP
Page.Options.Option.FcpInterfaceActive.Description=Activar la interfaz FCP para permitir a otros plugins y clientes remotos acceder al plugin de Sone.
Page.Options.Option.FcpFullAccessRequired.Description=Requiere conexión FCP de los hosts permitidos (Comprueva tu {link}configuración del nodo, sección âFCPâ{/link})
@@ -276,12 +272,6 @@ Page.DeleteAlbum.Text.AlbumWillBeGone=Esto eliminará tu álbum â{title}â. R
Page.DeleteAlbum.Button.Yes=Si, eliminar álbum.
Page.DeleteAlbum.Button.No=No, no eliminar álbum.
-Page.Trust.Title=Dar veracidad al Sone - Sone
-
-Page.Distrust.Title=Retirar veracidad al Sone - Sone
-
-Page.Untrust.Title=Quitar veracidad al Sone - Sone
-
Page.MarkAsKnown.Title=Marcar como conocido - Sone
Page.Bookmark.Title=Marcar - Sone
@@ -364,6 +354,7 @@ View.Sone.Status.Downloading=Este Sone está siendo descargado.
View.Sone.Status.Inserting=Este Sone está siendo insertado.
View.SoneMenu.Link.AllAlbums=todos los albumes
+View.SoneMenu.WebOfTrustLink=perfil de web of trust
View.Post.UnknownAuthor=(desconocido)
View.Post.WebOfTrustLink=perfil de web of trust
@@ -383,10 +374,6 @@ View.Post.ShowLess=mostrar menos
View.UpdateStatus.Text.ChooseSenderIdentity=Elegir la identidad del emisario
-View.Trust.Tooltip.Trust=Creer a esta persona
-View.Trust.Tooltip.Distrust=Asignar veracidad negativa a esta persona
-View.Trust.Tooltip.Untrust=Eliminar la veracidad asignada a esta persona
-
View.CreateAlbum.Title=Crear Ãlbum
View.CreateAlbum.Label.Name=Nombre:
View.CreateAlbum.Label.Description=Descripción:
@@ -437,9 +424,6 @@ WebInterface.DefaultText.Option.PostsPerPage=Número de publicaciones a mostrar
WebInterface.DefaultText.Option.ImagesPerPage=Número de imágenes a mostrar en una página
WebInterface.DefaultText.Option.CharactersPerPost=Número de carácteres de una publicación antes de acortarla
WebInterface.DefaultText.Option.PostCutOffLength=Número de carácteres de los fragmentos de la publicación acortada
-WebInterface.DefaultText.Option.PositiveTrust=Veracidad positiva a asignar
-WebInterface.DefaultText.Option.NegativeTrust=Veracidad negativa a asignar
-WebInterface.DefaultText.Option.TrustComment=Comentario a poner en Web of Trust
WebInterface.Button.Comment=Comentar
WebInterface.Confirmation.DeletePostButton=Si, eliminar!
WebInterface.Confirmation.DeleteReplyButton=Si, eliminar!
@@ -477,4 +461,4 @@ Notification.Mention.Text=Has sido mencionado en las siguientes publicaciones:
Notification.SoneIsInserting.Text=Tu Sone sone://{0} está siendo insertado.
Notification.SoneIsInserted.Text=Tu Sone sone://{0} ha sido insertado en {1,number} {1,choice,0#segundos|1#segundo|1<%sone.niceName|html>
(<%= View.Sone.Stats.Posts|l10n 0=sone.posts.size>, <%= View.Sone.Stats.Replies|l10n 0=sone.replies.size><%if ! sone.allImages.size|match value==0>, <%= View.Sone.Stats.Images|l10n 0=sone.allImages.size><%/if><%if core.debug>, <% sone.client|html><%/if>)
-