From 304cf43f37de2866339ddbdad25cbb04154d569c Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 5 Sep 2012 12:11:22 +0200 Subject: [PATCH] Use WOT connector to set trust values. --- src/main/java/net/pterodactylus/sone/core/TrustUpdater.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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); -- 2.7.4