X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Ffcp%2Fplugin%2FWebOfTrustPlugin.java;h=189689451e7f0cb511ac0de515d403b988064e98;hb=74fe9fe074dc290124ae270e0ab9be851c716436;hp=e240d42ef5697cbc12018449d7cbd344b18fa712;hpb=3ec55eade7b4de5b3191b09beb7fbdb52584d2ae;p=jFCPlib.git diff --git a/src/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java b/src/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java index e240d42..1896894 100644 --- a/src/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java +++ b/src/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java @@ -328,6 +328,25 @@ public class WebOfTrustPlugin { } } + /** + * Removes the given context from the given identity. + * + * @param ownIdentity + * The identity to remove the context from + * @param context + * The context to remove + * @throws IOException + * if an I/O error occurs + * @throws FcpException + * if an FCP error occurs + */ + public void removeContext(OwnIdentity ownIdentity, String context) throws IOException, FcpException { + Map replies = fcpClient.sendPluginMessage("plugins.WoT.WoT", createParameters("Message", "RemoveContext", "Identity", ownIdentity.getIdentifier(), "Context", context)); + if (!replies.get("Message").equals("ContextRemoved")) { + throw new FcpException("WebOfTrust Plugin did not reply with “ContextRemoved” message!"); + } + } + // // PRIVATE METHODS //