* @throws rocks.xmpp.core.stanza.model.StanzaException If the chat service returned a stanza error.
* @throws rocks.xmpp.core.session.NoResponseException If the chat service did not respond.
* @see <a href="http://xmpp.org/extensions/xep-0045.html#disco-roominfo">6.4 Querying for Room Information</a>
*/
public RoomInfo getRoomInfo() throws XmppException {
InfoNode infoNode = serviceDiscoveryManager.discoverInformation(roomJid);
Identity identity = null;
Set<MucFeature> mucFeatures = new HashSet<>();
RoomInfoForm roomInfoForm = null;
if (infoNode != null) {
Set<Identity> identities = infoNode.getIdentities();
Iterator<Identity> iterator = identities.iterator();
if (iterator.hasNext()) {
identity = iterator.next();
}
for (Feature feature : infoNode.getFeatures()) {
for (MucFeature mucFeature : MucFeature.values()) {
if (mucFeature.getServiceDiscoveryFeature().equals(feature.getVar())) {
mucFeatures.add(mucFeature);
}
}
}
for (DataForm dataForm : infoNode.getExtensions()) {
DataForm.Field formType = dataForm.findField("FORM_TYPE");
if (formType != null && !formType.getValues().isEmpty() && formType.getValues().get(0).equals("http://jabber.org/protocol/muc#roominfo")) {
roomInfoForm = new RoomInfoForm(dataForm);
break;
}