Commit 46943106 authored by Armando Jagucki's avatar Armando Jagucki Committed by ajagucki

Upon user deletion, the user's PEP nodes are removed from the database before...

Upon user deletion, the user's PEP nodes are removed from the database before their PEP service is removed.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9213 b35dd754-fafc-0310-a699-88a17e54d16e
parent 97335b1a
...@@ -607,8 +607,22 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider, ...@@ -607,8 +607,22 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider,
public void userDeleting(User user, Map<String, Object> params) { public void userDeleting(User user, Map<String, Object> params) {
JID bareJID = XMPPServer.getInstance().createJID(user.getUsername(), null); JID bareJID = XMPPServer.getInstance().createJID(user.getUsername(), null);
PEPService pepService = getPEPService(bareJID.toString());
// Remove the user's PEP service if it exists. if (pepService == null) {
return;
}
// Delete the user's PEP nodes from memory and the database.
CollectionNode rootNode = pepService.getRootCollectionNode();
for (Node node : pepService.getNodes()) {
if (rootNode.isChildNode(node)) {
node.delete();
}
}
rootNode.delete();
// Remove the user's PEP service, finally.
pepServices.remove(bareJID.toString()); pepServices.remove(bareJID.toString());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment