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

PEP: Disallow publishing of User Avatar until XEP-0084 is implemented.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/branches/pep@8914 b35dd754-fafc-0310-a699-88a17e54d16e
parent f4ae954e
...@@ -253,6 +253,15 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider, ...@@ -253,6 +253,15 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider,
Element publishElement = childElement.element("publish"); Element publishElement = childElement.element("publish");
if (publishElement != null) { if (publishElement != null) {
String nodeID = publishElement.attributeValue("node"); String nodeID = publishElement.attributeValue("node");
// Do not allow User Avatar nodes to be created.
// TODO: Implement XEP-0084
if (nodeID.startsWith("http://www.xmpp.org/extensions/xep-0084.html")) {
IQ reply = IQ.createResultIQ(packet);
reply.setChildElement(packet.getChildElement().createCopy());
reply.setError(PacketError.Condition.feature_not_implemented);
return reply;
}
if (pepService.getNode(nodeID) == null) { if (pepService.getNode(nodeID) == null) {
// Create the node // Create the node
...@@ -606,7 +615,7 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider, ...@@ -606,7 +615,7 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider,
JID jidFrom = packet.getFrom(); JID jidFrom = packet.getFrom();
JID jidTo = packet.getTo(); JID jidTo = packet.getTo();
if (!XMPPServer.getInstance().isLocal(jidFrom) && jidTo != null) { if (!XMPPServer.getInstance().isLocal(jidFrom) && jidFrom != null && jidTo != null) {
if (Log.isDebugEnabled()) { if (Log.isDebugEnabled()) {
Log.debug("PEP: received presence from: " + jidFrom + " to: " + jidTo); Log.debug("PEP: received presence from: " + jidFrom + " to: " + jidTo);
} }
......
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