Commit d61aa773 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Fixed several small issues.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@4846 b35dd754-fafc-0310-a699-88a17e54d16e
parent c4f7b688
......@@ -44,6 +44,13 @@
Search Plugin Changelog
</h1>
<p><b>1.1.7</b> -- August 7, 2006</p>
<ul>
<li>Fixed error when sent IQ packet has no type. Thanks to Alexander Gnauck.</li>
<li>Fixed error when sent IQ packet was of type ERROR or RESULT.</li>
<li>Fixed error when sent IQ packet contained data form fields with no values. Thanks to Alexander Gnauck.</li>
</ul>
<p><b>1.1.6</b> -- February 14, 2006</p>
<ul>
<li>Client Search - Fixed incorrect namespace returned in search resuslts.</li>
......
......@@ -5,8 +5,8 @@
<name>Search</name>
<description>Provides support for Jabber Search (JEP-0055)</description>
<author>Ryan Graham</author>
<version>1.1.6</version>
<date>02/14/2006</date>
<version>1.1.7</version>
<date>07/08/2006</date>
<minServerVersion>2.4.0</minServerVersion>
<adminconsole>
......
......@@ -31,6 +31,7 @@ import org.xmpp.component.ComponentManagerFactory;
import org.xmpp.packet.IQ;
import org.xmpp.packet.JID;
import org.xmpp.packet.Packet;
import org.xmpp.packet.PacketError;
import java.io.File;
import java.util.*;
......@@ -191,7 +192,9 @@ public class SearchPlugin implements Component, Plugin, PropertyEventListener {
if ("jabber:iq:search".equals(namespace)) {
try {
IQ replyPacket = handleIQ(packet);
componentManager.sendPacket(this, replyPacket);
if (replyPacket != null) {
componentManager.sendPacket(this, replyPacket);
}
}
catch (ComponentException e) {
componentManager.getLog().error(e);
......@@ -237,6 +240,17 @@ public class SearchPlugin implements Component, Plugin, PropertyEventListener {
}
else if (IQ.Type.set.equals(packet.getType())) {
return processSetPacket(packet);
} else
if (IQ.Type.result.equals(packet.getType()) || IQ.Type.error.equals(packet.getType())) {
// Ignore
}
else {
// Unknown type was sent so
IQ reply = new IQ(IQ.Type.error, packet.getID());
reply.setFrom(packet.getTo());
reply.setTo(packet.getFrom());
reply.setError(PacketError.Condition.bad_request);
return reply;
}
return null;
......@@ -326,7 +340,10 @@ public class SearchPlugin implements Component, Plugin, PropertyEventListener {
Element searchField = (Element) fields.next();
String field = searchField.attributeValue("var");
String value = searchField.element("value").getTextTrim();
String value = "";
if (searchField.element("value") != null) {
value = searchField.element("value").getTextTrim();
}
if (field.equals("search")) {
search = value;
}
......
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