Commit 0774f037 authored by Ryan Graham's avatar Ryan Graham Committed by ryang

These are the same changes made to search plugin in the wildfire branch

* Changed discovery category/type from "search/text" to "directory/user".
* Fixed UnsupportedOperationException if the client did not send a iq set/get prior to conducting a search.
* Fixed a possible issue that might prevent the plugin from being destroyed completely.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@7871 b35dd754-fafc-0310-a699-88a17e54d16e
parent 36521cff
...@@ -49,10 +49,17 @@ Search Plugin Changelog ...@@ -49,10 +49,17 @@ Search Plugin Changelog
<li>Now requires Openfire 3.3.0.</li> <li>Now requires Openfire 3.3.0.</li>
</ul> </ul>
<p><b>1.3.2</b> -- April 3, 2007</p>
<ul>
<li>Changed discovery category/type from "search/text" to "directory/user".</li>
<li>Fixed UnsupportedOperationException if the client did not send a iq set/get prior to conducting a search.</li>
<li>Fixed a possible issue that might prevent the plugin from being destroyed completely.</li>
</ul>
<p><b>1.3.1</b> -- March 12, 2007</p> <p><b>1.3.1</b> -- March 12, 2007</p>
<ul> <ul>
<li>Fixed UnsupportedOperationException from occuring when using LDAP.</li> <li>Fixed UnsupportedOperationException from occuring when using LDAP.</li>
<li>On the Advanced User Search unescape username in the search results.</a> <li>On the Advanced User Search unescape username in the search results.</li>
</ul> </ul>
<p><b>1.3.0</b> -- February 28, 2007</p> <p><b>1.3.0</b> -- February 28, 2007</p>
......
...@@ -75,6 +75,7 @@ public class SearchPlugin implements Component, Plugin, PropertyEventListener { ...@@ -75,6 +75,7 @@ public class SearchPlugin implements Component, Plugin, PropertyEventListener {
exculudedFields = StringUtils.stringToCollection(JiveGlobals.getProperty(EXCLUDEDFIELDS, "")); exculudedFields = StringUtils.stringToCollection(JiveGlobals.getProperty(EXCLUDEDFIELDS, ""));
serverName = XMPPServer.getInstance().getServerInfo().getName(); serverName = XMPPServer.getInstance().getServerInfo().getName();
userManager = UserManager.getInstance();
// Some clients, such as Miranda, are hard-coded to search specific fields, // Some clients, such as Miranda, are hard-coded to search specific fields,
// so we map those fields to the fields that Openfire actually supports. // so we map those fields to the fields that Openfire actually supports.
...@@ -124,10 +125,12 @@ public class SearchPlugin implements Component, Plugin, PropertyEventListener { ...@@ -124,10 +125,12 @@ public class SearchPlugin implements Component, Plugin, PropertyEventListener {
catch (Exception e) { catch (Exception e) {
componentManager.getLog().error(e); componentManager.getLog().error(e);
} }
serviceName = null;
userManager = null; userManager = null;
exculudedFields = null;
serverName = null;
fieldLookup = null; fieldLookup = null;
reverseFieldLookup = null; reverseFieldLookup = null;
exculudedFields = null;
} }
public void shutdown() { public void shutdown() {
...@@ -160,8 +163,8 @@ public class SearchPlugin implements Component, Plugin, PropertyEventListener { ...@@ -160,8 +163,8 @@ public class SearchPlugin implements Component, Plugin, PropertyEventListener {
Element responseElement = replyPacket Element responseElement = replyPacket
.setChildElement("query", "http://jabber.org/protocol/disco#info"); .setChildElement("query", "http://jabber.org/protocol/disco#info");
responseElement.addElement("identity").addAttribute("category", "search") responseElement.addElement("identity").addAttribute("category", "directory")
.addAttribute("type", "text") .addAttribute("type", "user")
.addAttribute("name", "User Search"); .addAttribute("name", "User Search");
responseElement.addElement("feature").addAttribute("var", "jabber:iq:search"); responseElement.addElement("feature").addAttribute("var", "jabber:iq:search");
...@@ -457,7 +460,6 @@ public class SearchPlugin implements Component, Plugin, PropertyEventListener { ...@@ -457,7 +460,6 @@ public class SearchPlugin implements Component, Plugin, PropertyEventListener {
// See if the installed provider supports searching. If not, workaround // See if the installed provider supports searching. If not, workaround
// by providing our own searching. // by providing our own searching.
try { try {
userManager = UserManager.getInstance();
searchFields = new ArrayList<String>(userManager.getSearchFields()); searchFields = new ArrayList<String>(userManager.getSearchFields());
} }
catch (UnsupportedOperationException uoe) { catch (UnsupportedOperationException uoe) {
......
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