Commit 8c819828 authored by Axel Brand's avatar Axel Brand Committed by daeva

generating to and from only if packet may be of relevance

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/branches/plugins@13548 b35dd754-fafc-0310-a699-88a17e54d16e
parent 4eacf951
...@@ -100,14 +100,20 @@ public class MainInterceptor implements PacketInterceptor { ...@@ -100,14 +100,20 @@ public class MainInterceptor implements PacketInterceptor {
public void interceptPacket(Packet packet, Session session, boolean incoming, boolean processed) throws PacketRejectedException { public void interceptPacket(Packet packet, Session session, boolean incoming, boolean processed) throws PacketRejectedException {
if (frozen) if (frozen)
return; return;
//Generating from and to Only when the package may be of relevance
String from, to; String from = "";
try { String to = "";
from = (packet.getFrom() != null) ? packet.getFrom().toString() : ""; if (incoming || (!incoming && processed)) {
to = (packet.getTo() != null) ? packet.getTo().toString() : ""; try {
} catch (IllegalArgumentException e) { if (packet.getFrom() != null)
Log.warn("There was an illegal JID while intercepting Message for GoJara. Not Intercepting it! " + e.getMessage()); from = packet.getFrom().toString();
return; if (packet.getTo() != null)
to = packet.getTo().toString();
} catch (IllegalArgumentException e) {
Log.warn("There was an illegal JID while intercepting Message for GoJara. Not Intercepting it! " + e.getMessage());
return;
}
} }
if (incoming && processed) { if (incoming && processed) {
......
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