}
public DataForm getExtendedInfo(String name, String node, JID senderJID) {
if (name != null && node == null) {
// Answer the extended info of a given room
MUCRoom room = getChatRoom(name);
if (room != null && canDiscoverRoom(room)) {
final DataForm dataForm = new DataForm(Type.result);
final FormField fieldType = dataForm.addField();
fieldType.setVariable("FORM_TYPE");
fieldType.setType(FormField.Type.hidden);
fieldType.addValue("http://jabber.org/protocol/muc#roominfo");
final FormField fieldDescr = dataForm.addField();
fieldDescr.setVariable("muc#roominfo_description");
fieldDescr.setLabel(LocaleUtils.getLocalizedString("muc.extended.info.desc"));
fieldDescr.addValue(room.getDescription());
final FormField fieldSubj = dataForm.addField();
fieldSubj.setVariable("muc#roominfo_subject");
fieldSubj.setLabel(LocaleUtils.getLocalizedString("muc.extended.info.subject"));
fieldSubj.addValue(room.getSubject());
/*final FormField fieldOcc = dataForm.addField(); */
fieldSubj.setVariable("muc#roominfo_occupants");
fieldSubj.setLabel(LocaleUtils.getLocalizedString("muc.extended.info.occupants"));
fieldSubj.addValue(Integer.toString(room.getOccupantsCount()));
/*field = new XFormFieldImpl("muc#roominfo_lang");
field.setLabel(LocaleUtils.getLocalizedString("muc.extended.info.language"));
field.addValue(room.getLanguage());
dataForm.addField(field);*/
final FormField fieldDate = dataForm.addField();
fieldDate.setVariable("x-muc#roominfo_creationdate");
fieldDate.setLabel(LocaleUtils.getLocalizedString("muc.extended.info.creationdate"));
fieldDate.addValue(dateFormatter.format(room.getCreationDate()));
return dataForm;
}
}
return null;