Commit 6d34c564 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Make sure that only one disco#item exists for each component.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1261 b35dd754-fafc-0310-a699-88a17e54d16e
parent c1bd7356
...@@ -194,6 +194,10 @@ public class IQDiscoItemsHandler extends IQHandler implements ServerFeaturesProv ...@@ -194,6 +194,10 @@ public class IQDiscoItemsHandler extends IQHandler implements ServerFeaturesProv
* @param name the discovered name of the component. * @param name the discovered name of the component.
*/ */
public void addComponentItem(String jid, String name) { public void addComponentItem(String jid, String name) {
// A component may send his disco#info many times and we only want to have one item
// for the component so remove any element under the requested jid
removeComponentItem(jid);
// Create a new element based on the provided DiscoItem // Create a new element based on the provided DiscoItem
Element element = DocumentHelper.createElement("item"); Element element = DocumentHelper.createElement("item");
element.addAttribute("jid", jid); element.addAttribute("jid", jid);
......
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