Commit 044349c3 authored by Tom Evans's avatar Tom Evans Committed by tevans

[Bamboo #314] Remove references to 1.6 APIs in gojara plugin (Openfire uses Java 5)

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13595 b35dd754-fafc-0310-a699-88a17e54d16e
parent 9a338b7a
...@@ -75,7 +75,7 @@ public class MainInterceptor implements PacketInterceptor { ...@@ -75,7 +75,7 @@ public class MainInterceptor implements PacketInterceptor {
* we find it. * we find it.
*/ */
private String searchJIDforSubdomain(String jid) { private String searchJIDforSubdomain(String jid) {
if (!jid.isEmpty()) { if (jid.length() > 0) {
for (String subdomain : activeTransports) { for (String subdomain : activeTransports) {
if (jid.contains(subdomain)) if (jid.contains(subdomain))
return subdomain; return subdomain;
...@@ -120,14 +120,14 @@ public class MainInterceptor implements PacketInterceptor { ...@@ -120,14 +120,14 @@ public class MainInterceptor implements PacketInterceptor {
return; return;
// Jabber:IQ:roster Indicates Client to Component update or Rosterpush // Jabber:IQ:roster Indicates Client to Component update or Rosterpush
else if (query.getNamespaceURI().equals("jabber:iq:roster")) { else if (query.getNamespaceURI().equals("jabber:iq:roster")) {
if (to.isEmpty() && iqPacket.getType().equals(IQ.Type.set)) if (to.length() == 0 && iqPacket.getType().equals(IQ.Type.set))
packetProcessors.get("clientToComponentUpdate").process(packet, "", to, from); packetProcessors.get("clientToComponentUpdate").process(packet, "", to, from);
else if (!from.isEmpty() && activeTransports.contains(from)) else if (from.length() > 0 && activeTransports.contains(from))
packetProcessors.get("iqRosterPayload").process(packet, from, to, from); packetProcessors.get("iqRosterPayload").process(packet, from, to, from);
} }
// SPARK IQ REGISTERED Feature // SPARK IQ REGISTERED Feature
else if (query.getNamespaceURI().equals("http://jabber.org/protocol/disco#info") && !to.isEmpty() else if (query.getNamespaceURI().equals("http://jabber.org/protocol/disco#info") && to.length() > 0 &&
&& activeTransports.contains(to) && iqPacket.getType().equals(IQ.Type.get)) { activeTransports.contains(to) && iqPacket.getType().equals(IQ.Type.get)) {
packetProcessors.get("sparkIQRegistered").process(packet, to, to, from); packetProcessors.get("sparkIQRegistered").process(packet, to, to, from);
} }
// JABBER:IQ:LAST - Autoresponse Feature // JABBER:IQ:LAST - Autoresponse Feature
...@@ -135,7 +135,7 @@ public class MainInterceptor implements PacketInterceptor { ...@@ -135,7 +135,7 @@ public class MainInterceptor implements PacketInterceptor {
&& query.getNamespaceURI().equals("jabber:iq:last")) { && query.getNamespaceURI().equals("jabber:iq:last")) {
String to_s = searchJIDforSubdomain(to); String to_s = searchJIDforSubdomain(to);
if (!to_s.isEmpty() && iqPacket.getType().equals(IQ.Type.get)) if (to_s.length() > 0 && iqPacket.getType().equals(IQ.Type.get))
throw new PacketRejectedException(); throw new PacketRejectedException();
} }
// NONPERSISTANT Feature // NONPERSISTANT Feature
...@@ -149,8 +149,8 @@ public class MainInterceptor implements PacketInterceptor { ...@@ -149,8 +149,8 @@ public class MainInterceptor implements PacketInterceptor {
// STATISTICS - Feature // STATISTICS - Feature
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.length() == 0 ? to_s : from_s;
if (!from.equals(to) && !subdomain.isEmpty()) if (!from.equals(to) && subdomain.length() > 0)
packetProcessors.get("statisticsProcessor").process(packet, subdomain, to, from); packetProcessors.get("statisticsProcessor").process(packet, subdomain, to, from);
} else if (!incoming && !processed) { } else if (!incoming && !processed) {
...@@ -166,14 +166,14 @@ public class MainInterceptor implements PacketInterceptor { ...@@ -166,14 +166,14 @@ public class MainInterceptor implements PacketInterceptor {
packetProcessors.get("whitelistProcessor").process(packet, "", to, from); packetProcessors.get("whitelistProcessor").process(packet, "", to, from);
// DISCO#INFO - MUC-Filter-Feature // DISCO#INFO - MUC-Filter-Feature
else if (JiveGlobals.getBooleanProperty("plugin.remoteroster.mucFilter", false) else if (JiveGlobals.getBooleanProperty("plugin.remoteroster.mucFilter", false)
&& query.getNamespaceURI().equals("http://jabber.org/protocol/disco#info") && !from.isEmpty() && query.getNamespaceURI().equals("http://jabber.org/protocol/disco#info") && from.length() > 0
&& activeTransports.contains(from)) && activeTransports.contains(from))
packetProcessors.get("mucfilterProcessor").process(packet, from, to, from); packetProcessors.get("mucfilterProcessor").process(packet, from, to, from);
} else if (packet instanceof Presence) { } else if (packet instanceof Presence) {
// We block Presences to users of a subdomain so OF/S2 wont log you in automatically if you have a // We block Presences to users of a subdomain so OF/S2 wont log you in automatically if you have a
// subdomain user in your roster // subdomain user in your roster
String to_s = searchJIDforSubdomain(to); String to_s = searchJIDforSubdomain(to);
if (!to_s.isEmpty() && !activeTransports.contains(to)) if (to_s.length() > 0 && !activeTransports.contains(to))
throw new PacketRejectedException(); throw new PacketRejectedException();
} }
} }
......
...@@ -54,7 +54,7 @@ public class ClientToComponentUpdateProcessor extends AbstractRemoteRosterProces ...@@ -54,7 +54,7 @@ public class ClientToComponentUpdateProcessor extends AbstractRemoteRosterProces
// conflicts // conflicts
// when we remove our legacy network registration. // when we remove our legacy network registration.
String found_subdomain = searchJIDforSubdomain(jid); String found_subdomain = searchJIDforSubdomain(jid);
if (!found_subdomain.isEmpty() && !n.valueOf("@subscription").equals("remove")) { if (found_subdomain.length() > 0 && !n.valueOf("@subscription").equals("remove")) {
Log.debug("Mirroring packet from local network to legacy component " + found_subdomain); Log.debug("Mirroring packet from local network to legacy component " + found_subdomain);
IQ forward = (IQ) packet.createCopy(); IQ forward = (IQ) packet.createCopy();
......
...@@ -27,7 +27,7 @@ public class MucFilterProcessor extends AbstractRemoteRosterProcessor { ...@@ -27,7 +27,7 @@ public class MucFilterProcessor extends AbstractRemoteRosterProcessor {
public void process(Packet packet, String subdomain, String to, String from) throws PacketRejectedException { public void process(Packet packet, String subdomain, String to, String from) throws PacketRejectedException {
IQ iqPacket = (IQ) packet; IQ iqPacket = (IQ) packet;
if (iqPacket.getType().equals(IQ.Type.result) && !to.isEmpty()) { if (iqPacket.getType().equals(IQ.Type.result) && to.length() > 0) {
Element root = iqPacket.getChildElement(); Element root = iqPacket.getChildElement();
List<Node> nodes = XpathHelper.findNodesInDocument(root.getDocument(), "//disco:feature"); List<Node> nodes = XpathHelper.findNodesInDocument(root.getDocument(), "//disco:feature");
......
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