From: David ‘Bombe’ Roden Date: Mon, 3 Jan 2011 06:22:44 +0000 (+0100) Subject: Update trust cache for target identity. X-Git-Tag: 0.4^2~8^2~19 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=028d7e98954c9dbeae4515146c36d55dddd7f648;p=Sone.git Update trust cache for target identity. --- diff --git a/src/main/java/net/pterodactylus/sone/freenet/wot/DefaultOwnIdentity.java b/src/main/java/net/pterodactylus/sone/freenet/wot/DefaultOwnIdentity.java index 9a104e8..ab96756 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/wot/DefaultOwnIdentity.java +++ b/src/main/java/net/pterodactylus/sone/freenet/wot/DefaultOwnIdentity.java @@ -150,6 +150,9 @@ public class DefaultOwnIdentity extends DefaultIdentity implements OwnIdentity { public void setTrust(Identity target, int trustValue, String comment) throws WebOfTrustException { Validation.begin().isNotNull("Trust Target", target).isNotNull("Trust Comment", comment).isLessOrEqual("Trust Value", trustValue, 100).isGreaterOrEqual("Trust Value", trustValue, -100).check(); webOfTrustConnector.setTrust(this, target, trustValue, comment); + if (target instanceof DefaultIdentity) { + ((DefaultIdentity) target).setTrustPrivate(this, new Trust(trustValue, trustValue, 0)); + } } /** @@ -159,6 +162,9 @@ public class DefaultOwnIdentity extends DefaultIdentity implements OwnIdentity { public void removeTrust(Identity target) throws WebOfTrustException { Validation.begin().isNotNull("Trust Target", target).check(); webOfTrustConnector.removeTrust(this, target); + if (target instanceof DefaultIdentity) { + ((DefaultIdentity) target).setTrustPrivate(this, new Trust(null, null, null)); + } } }