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 @@ ...@@ -44,6 +44,13 @@
Search Plugin Changelog Search Plugin Changelog
</h1> </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> <p><b>1.1.6</b> -- February 14, 2006</p>
<ul> <ul>
<li>Client Search - Fixed incorrect namespace returned in search resuslts.</li> <li>Client Search - Fixed incorrect namespace returned in search resuslts.</li>
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<name>Search</name> <name>Search</name>
<description>Provides support for Jabber Search (JEP-0055)</description> <description>Provides support for Jabber Search (JEP-0055)</description>
<author>Ryan Graham</author> <author>Ryan Graham</author>
<version>1.1.6</version> <version>1.1.7</version>
<date>02/14/2006</date> <date>07/08/2006</date>
<minServerVersion>2.4.0</minServerVersion> <minServerVersion>2.4.0</minServerVersion>
<adminconsole> <adminconsole>
......
...@@ -31,6 +31,7 @@ import org.xmpp.component.ComponentManagerFactory; ...@@ -31,6 +31,7 @@ import org.xmpp.component.ComponentManagerFactory;
import org.xmpp.packet.IQ; import org.xmpp.packet.IQ;
import org.xmpp.packet.JID; import org.xmpp.packet.JID;
import org.xmpp.packet.Packet; import org.xmpp.packet.Packet;
import org.xmpp.packet.PacketError;
import java.io.File; import java.io.File;
import java.util.*; import java.util.*;
...@@ -191,8 +192,10 @@ public class SearchPlugin implements Component, Plugin, PropertyEventListener { ...@@ -191,8 +192,10 @@ public class SearchPlugin implements Component, Plugin, PropertyEventListener {
if ("jabber:iq:search".equals(namespace)) { if ("jabber:iq:search".equals(namespace)) {
try { try {
IQ replyPacket = handleIQ(packet); IQ replyPacket = handleIQ(packet);
if (replyPacket != null) {
componentManager.sendPacket(this, replyPacket); componentManager.sendPacket(this, replyPacket);
} }
}
catch (ComponentException e) { catch (ComponentException e) {
componentManager.getLog().error(e); componentManager.getLog().error(e);
} }
...@@ -237,6 +240,17 @@ public class SearchPlugin implements Component, Plugin, PropertyEventListener { ...@@ -237,6 +240,17 @@ public class SearchPlugin implements Component, Plugin, PropertyEventListener {
} }
else if (IQ.Type.set.equals(packet.getType())) { else if (IQ.Type.set.equals(packet.getType())) {
return processSetPacket(packet); 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; return null;
...@@ -326,7 +340,10 @@ public class SearchPlugin implements Component, Plugin, PropertyEventListener { ...@@ -326,7 +340,10 @@ public class SearchPlugin implements Component, Plugin, PropertyEventListener {
Element searchField = (Element) fields.next(); Element searchField = (Element) fields.next();
String field = searchField.attributeValue("var"); 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")) { if (field.equals("search")) {
search = value; 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