diff --git a/src/main/java/com/buddycloud/mediaserver/xmpp/MediaServerComponent.java b/src/main/java/com/buddycloud/mediaserver/xmpp/MediaServerComponent.java index e6d24bb..9db0ede 100644 --- a/src/main/java/com/buddycloud/mediaserver/xmpp/MediaServerComponent.java +++ b/src/main/java/com/buddycloud/mediaserver/xmpp/MediaServerComponent.java @@ -105,7 +105,15 @@ protected IQ handleDiscoInfo(IQ iq) { IQ disco = super.handleDiscoInfo(iq); String endPoint = configuration.getProperty(MediaServerConfiguration.HTTP_ENDPOINT); if (endPoint != null) { + Element queryEl = disco.getElement().element("query"); + addIdentity(queryEl, "component", getName(), "generic"); + + addFeature(queryEl, NAMESPACE_DISCO_INFO); + addFeature(queryEl, NAMESPACE_XMPP_PING); + addFeature(queryEl, NAMESPACE_LAST_ACTIVITY); + addFeature(queryEl, NAMESPACE_ENTITY_TIME); + Element xEl = queryEl.addElement("x", "jabber:x:data"); xEl.addAttribute("type", "result"); @@ -117,6 +125,18 @@ protected IQ handleDiscoInfo(IQ iq) { return disco; } + private void addIdentity(Element e, String category, String name, String type) { + Element identity = e.addElement("identity"); + identity.addAttribute("category", category); + identity.addAttribute("name", name); + identity.addAttribute("type", type); + } + + private void addFeature(Element e, String var) { + Element feature = e.addElement("feature"); + feature.addAttribute("var", var); + } + private void addField(Element xEl, String var, String type, String value) { Element fieldEl = xEl.addElement("field");