From: David ‘Bombe’ Roden Date: Wed, 5 Sep 2012 10:09:50 +0000 (+0200) Subject: Use trust updater to set trust values. X-Git-Tag: 0.8.3^2~54^2~10 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ed79caa2308c08a69b077dfb80728a9d78780d0b;p=Sone.git Use trust updater to set trust values. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 4ea95a6..d496c35 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -1074,11 +1074,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis */ public void setTrust(Sone origin, Sone target, int trustValue) { Validation.begin().isNotNull("Trust Origin", origin).check().isInstanceOf("Trust Origin", origin.getIdentity(), OwnIdentity.class).isNotNull("Trust Target", target).isLessOrEqual("Trust Value", trustValue, 100).isGreaterOrEqual("Trust Value", trustValue, -100).check(); - try { - ((OwnIdentity) origin.getIdentity()).setTrust(target.getIdentity(), trustValue, preferences.getTrustComment()); - } catch (WebOfTrustException wote1) { - logger.log(Level.WARNING, String.format("Could not set trust for Sone: %s", target), wote1); - } + trustUpdater.setTrust((OwnIdentity) origin.getIdentity(), target.getIdentity(), trustValue, preferences.getTrustComment()); } /** @@ -1091,11 +1087,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis */ public void removeTrust(Sone origin, Sone target) { Validation.begin().isNotNull("Trust Origin", origin).isNotNull("Trust Target", target).check().isInstanceOf("Trust Origin Identity", origin.getIdentity(), OwnIdentity.class).check(); - try { - ((OwnIdentity) origin.getIdentity()).removeTrust(target.getIdentity()); - } catch (WebOfTrustException wote1) { - logger.log(Level.WARNING, String.format("Could not remove trust for Sone: %s", target), wote1); - } + trustUpdater.setTrust((OwnIdentity) origin.getIdentity(), target.getIdentity(), null, null); } /**