From: David ‘Bombe’ Roden Date: Wed, 5 Sep 2012 10:11:22 +0000 (+0200) Subject: Use WOT connector to set trust values. X-Git-Tag: 0.8.3^2~54^2~9 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=304cf43f37de2866339ddbdad25cbb04154d569c;p=Sone.git Use WOT connector to set trust values. --- diff --git a/src/main/java/net/pterodactylus/sone/core/TrustUpdater.java b/src/main/java/net/pterodactylus/sone/core/TrustUpdater.java index 6221d39..a86b353 100644 --- a/src/main/java/net/pterodactylus/sone/core/TrustUpdater.java +++ b/src/main/java/net/pterodactylus/sone/core/TrustUpdater.java @@ -180,7 +180,7 @@ public class TrustUpdater extends AbstractService { * * @author David ‘Bombe’ Roden */ - private static class SetTrustJob extends TrustUpdateJob { + private class SetTrustJob extends TrustUpdateJob { /** The score of the relation. */ private final Integer score; @@ -215,9 +215,15 @@ public class TrustUpdater extends AbstractService { public void run() { try { if (score != null) { - truster.setTrust(trustee, score, comment); + if (trustee instanceof DefaultIdentity) { + ((DefaultIdentity) trustee).setTrust(truster, new Trust(score, null, 0)); + } + webOfTrustConnector.setTrust(truster, trustee, score, comment); } else { - truster.removeTrust(trustee); + if (trustee instanceof DefaultIdentity) { + ((DefaultIdentity) trustee).setTrust(truster, null); + } + webOfTrustConnector.removeTrust(truster, trustee); } } catch (WebOfTrustException wote1) { logger.log(Level.WARNING, "Could not set Trust value for " + truster + " -> " + trustee + " to " + score + " (" + comment + ")!", wote1);