mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-24 04:52:05 +01:00
Add method to delete pubkey node
This commit is contained in:
parent
70538ecc90
commit
7b222d8c58
1 changed files with 25 additions and 0 deletions
|
@ -218,6 +218,31 @@ public class PubSubDelegate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete the public key node of the key with fingerprint {@code fingerprint}.
|
||||||
|
*
|
||||||
|
* @param connection
|
||||||
|
* @param fingerprint
|
||||||
|
* @throws XMPPException.XMPPErrorException
|
||||||
|
* @throws SmackException.NotConnectedException
|
||||||
|
* @throws InterruptedException
|
||||||
|
* @throws SmackException.NoResponseException
|
||||||
|
*/
|
||||||
|
public static void deletePublicKeyNode(XMPPConnection connection, OpenPgpV4Fingerprint fingerprint)
|
||||||
|
throws XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException,
|
||||||
|
SmackException.NoResponseException {
|
||||||
|
PubSubManager pm = PubSubManager.getInstance(connection, connection.getUser().asBareJid());
|
||||||
|
try {
|
||||||
|
pm.deleteNode(PEP_NODE_PUBLIC_KEY(fingerprint));
|
||||||
|
} catch (XMPPException.XMPPErrorException e) {
|
||||||
|
if (e.getXMPPError().getCondition() == StanzaError.Condition.item_not_found) {
|
||||||
|
LOGGER.log(Level.FINE, "Node does not exist. No need to delete it.");
|
||||||
|
} else {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch the OpenPGP public key of a {@code contact}, identified by its OpenPGP {@code v4_fingerprint}.
|
* Fetch the OpenPGP public key of a {@code contact}, identified by its OpenPGP {@code v4_fingerprint}.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue