Don’t cache contexts.
[Sone.git] / src / main / java / net / pterodactylus / sone / freenet / wot / OwnIdentity.java
index 74b5f6a..2384520 100644 (file)
@@ -65,11 +65,12 @@ public class OwnIdentity extends Identity {
         *
         * @param context
         *            The context to add
+        * @throws PluginException
+        *             if an error occured communicating with the Web of Trust
+        *             plugin
         */
-       public void addContext(String context) {
-               if (contexts.add(context)) {
-                       /* TODO - add. */
-               }
+       public void addContext(String context) throws PluginException {
+               webOfTrustConnector.addContext(this, context);
        }
 
        /**
@@ -77,11 +78,12 @@ public class OwnIdentity extends Identity {
         *
         * @param context
         *            The context to remove
+        * @throws PluginException
+        *             if an error occured communicating with the Web of Trust
+        *             plugin
         */
-       public void removeContext(String context) {
-               if (contexts.remove(context)) {
-                       /* TODO - remove */
-               }
+       public void removeContext(String context) throws PluginException {
+               webOfTrustConnector.removeContext(this, context);
        }
 
        /**