Commit b0970725 authored by Axel Brand's avatar Axel Brand Committed by daeva

git-svn-id:...

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/branches/plugins@13549 b35dd754-fafc-0310-a699-88a17e54d16e
parent 8c819828
...@@ -137,7 +137,6 @@ public class RemoteRosterPlugin implements Plugin { ...@@ -137,7 +137,6 @@ public class RemoteRosterPlugin implements Plugin {
iManager.removeInterceptor(mainInterceptor); iManager.removeInterceptor(mainInterceptor);
PropertyEventDispatcher.removeListener(_settingsObserver); PropertyEventDispatcher.removeListener(_settingsObserver);
pluginManager = null; pluginManager = null;
mainInterceptor = null;
} }
private void updateInterceptors(String componentJID) { private void updateInterceptors(String componentJID) {
......
...@@ -69,8 +69,6 @@ public class MainInterceptor implements PacketInterceptor { ...@@ -69,8 +69,6 @@ public class MainInterceptor implements PacketInterceptor {
// shutting down our Interceptor better safe then sorry // shutting down our Interceptor better safe then sorry
public void freeze() { public void freeze() {
frozen = true; frozen = true;
activeTransports = null;
packetProcessors = null;
} }
/** /**
...@@ -100,10 +98,11 @@ public class MainInterceptor implements PacketInterceptor { ...@@ -100,10 +98,11 @@ 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 = ""; String from = "";
String to = ""; String to = "";
if (incoming || (!incoming && processed)) { if (!processed || (incoming && processed)){
try { try {
if (packet.getFrom() != null) if (packet.getFrom() != null)
from = packet.getFrom().toString(); from = packet.getFrom().toString();
...@@ -113,13 +112,13 @@ public class MainInterceptor implements PacketInterceptor { ...@@ -113,13 +112,13 @@ public class MainInterceptor implements PacketInterceptor {
Log.warn("There was an illegal JID while intercepting Message for GoJara. Not Intercepting it! " + e.getMessage()); Log.warn("There was an illegal JID while intercepting Message for GoJara. Not Intercepting it! " + e.getMessage());
return; return;
} }
} }
if (incoming && processed) {
if (incoming && !processed) {
// We ignore Pings from S2 to S2 itself. We test for Log first so // We ignore Pings from S2 to S2 itself. We test for Log first so
// that we can return in case // that we can return in case
// The packet doesnt have any watched namespace. // The packet doesnt have any watched namespace, but we still may want to log it.
String from_s = searchJIDforSubdomain(from); String from_s = searchJIDforSubdomain(from);
String to_s = searchJIDforSubdomain(to); String to_s = searchJIDforSubdomain(to);
String subdomain = from_s.isEmpty() ? to_s : from_s; String subdomain = from_s.isEmpty() ? to_s : from_s;
...@@ -154,7 +153,7 @@ public class MainInterceptor implements PacketInterceptor { ...@@ -154,7 +153,7 @@ public class MainInterceptor implements PacketInterceptor {
packetProcessors.get("handleNonPersistant").process(packet, from, to, from); packetProcessors.get("handleNonPersistant").process(packet, from, to, from);
} }
} else if (incoming && !processed && JiveGlobals.getBooleanProperty("plugin.remoteroster.iqLastFilter", false)) { } else if (incoming && processed && JiveGlobals.getBooleanProperty("plugin.remoteroster.iqLastFilter", false)) {
// JABBER:IQ:LAST // JABBER:IQ:LAST
if (packet instanceof IQ) { if (packet instanceof IQ) {
IQ myPacket = (IQ) packet; IQ myPacket = (IQ) packet;
...@@ -168,7 +167,7 @@ public class MainInterceptor implements PacketInterceptor { ...@@ -168,7 +167,7 @@ public class MainInterceptor implements PacketInterceptor {
} }
} }
} }
} else if (!incoming && processed) { } else if (!incoming && !processed) {
// DISCO#ITEMS - Whitelisting Feature // DISCO#ITEMS - Whitelisting Feature
if (packet instanceof IQ) { if (packet instanceof IQ) {
......
...@@ -45,14 +45,12 @@ public class IQRosterPayloadProcessor extends AbstractRemoteRosterProcessor { ...@@ -45,14 +45,12 @@ public class IQRosterPayloadProcessor extends AbstractRemoteRosterProcessor {
Log.debug("Processing packet in SendRosterProcessor for " + subdomain); Log.debug("Processing packet in SendRosterProcessor for " + subdomain);
IQ myPacket = (IQ) packet; IQ myPacket = (IQ) packet;
Element query = myPacket.getChildElement();
String username = getUsernameFromJid(to); String username = getUsernameFromJid(to);
if (query != null && query.getNamespaceURI().equals("jabber:iq:roster")) {
if (myPacket.getType().equals(IQ.Type.get)) { if (myPacket.getType().equals(IQ.Type.get)) {
handleIQget(myPacket, subdomain, username); handleIQget(myPacket, subdomain, username);
} else if (myPacket.getType().equals(IQ.Type.set)) { } else if (myPacket.getType().equals(IQ.Type.set)) {
handleIQset(myPacket, subdomain, username); handleIQset(myPacket, subdomain, username);
}
} }
} }
......
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