if (log.isDebugEnabled()) {
log.debug("Iq Disco Info query " + debugString(iq) + " node: " + query.getNode() + " features: " + query.getFeature() + " identity: " + query.getIdentity());
}
Iq result = createResult(iq);
org.jabber.protocol.disco_info.Query answer = new org.jabber.protocol.disco_info.Query();
answer.setNode(to);
answer.getFeature().add(createFeature("http://jabber.org/protocol/disco#info"));
answer.getFeature().add(createFeature("http://jabber.org/protocol/disco#items"));
if (to == null || to.length() == 0) {
answer.getIdentity().add(createIdentity("directory", "chatroom", "queues"));
answer.getIdentity().add(createIdentity("directory", "chatroom", "topics"));
/*
answer.getIdentity().add(createIdentity("hierarchy", "queues", "branch"));
answer.getIdentity().add(createIdentity("hierarchy", "topics", "branch"));
*/
}
else {
// for queues/topics
if (to.equals("queues")) {
answer.getIdentity().add(createIdentity("conference", "queue.a", "text"));
answer.getIdentity().add(createIdentity("conference", "queue.b", "text"));
}
else if (to.equals("topics")) {
answer.getIdentity().add(createIdentity("conference", "topic.x", "text"));
answer.getIdentity().add(createIdentity("conference", "topic.y", "text"));
answer.getIdentity().add(createIdentity("conference", "topic.z", "text"));
}
else {
// lets reply to an actual room
answer.getIdentity().add(createIdentity("conference", to, "text"));
answer.getFeature().add(createFeature("http://jabber.org/protocol/muc"));
answer.getFeature().add(createFeature("muc-open"));
}
}
result.setAny(answer);
transport.marshall(result);
}