Commit 00c7fd43 authored by Armando Jagucki's avatar Armando Jagucki Committed by ajagucki

Increased readability in IQPEPHandler.handleIQ().

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9244 b35dd754-fafc-0310-a699-88a17e54d16e
parent b3a70feb
...@@ -239,7 +239,8 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider, ...@@ -239,7 +239,8 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider,
@Override @Override
public IQ handleIQ(IQ packet) throws UnauthorizedException { public IQ handleIQ(IQ packet) throws UnauthorizedException {
JID senderJID = packet.getFrom(); JID senderJID = packet.getFrom();
if (packet.getTo() == null && packet.getType() == IQ.Type.set) { if (packet.getTo() == null) {
if (packet.getType() == IQ.Type.set) {
String jidFrom = senderJID.toBareJID(); String jidFrom = senderJID.toBareJID();
PEPService pepService = getPEPService(jidFrom); PEPService pepService = getPEPService(jidFrom);
...@@ -306,7 +307,7 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider, ...@@ -306,7 +307,7 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider,
// Process with PubSub as usual. // Process with PubSub as usual.
pubSubEngine.process(pepService, packet); pubSubEngine.process(pepService, packet);
}
} }
else if (packet.getType() == IQ.Type.get || packet.getType() == IQ.Type.set) { else if (packet.getType() == IQ.Type.get || packet.getType() == IQ.Type.set) {
String jidTo = packet.getTo().toBareJID(); String jidTo = packet.getTo().toBareJID();
...@@ -319,8 +320,8 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider, ...@@ -319,8 +320,8 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider,
else { else {
// Process with PubSub using a dummyService. In the case where an IQ packet is sent to // Process with PubSub using a dummyService. In the case where an IQ packet is sent to
// a user who does not have a PEP service, we wish to utilize the error reporting flow // a user who does not have a PEP service, we wish to utilize the error reporting flow
// already present in the PubSubEngine. Hence, the sole purpose of the dummyService is // already present in the PubSubEngine. This gives the illusion that every user has a
// to forward this ill formed IQ packet to the PubSubEngine and trigger the correct error. // PEP service, as required by the specification.
PEPService dummyService = new PEPService(XMPPServer.getInstance(), senderJID.toBareJID()); PEPService dummyService = new PEPService(XMPPServer.getInstance(), senderJID.toBareJID());
pubSubEngine.process(dummyService, packet); pubSubEngine.process(dummyService, packet);
} }
...@@ -331,7 +332,7 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider, ...@@ -331,7 +332,7 @@ public class IQPEPHandler extends IQHandler implements ServerIdentitiesProvider,
return null; return null;
} }
// Other error flows are handled in pubSubEngine.process(...) // Other error flows were handled in pubSubEngine.process(...)
return null; return null;
} }
......
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