reply.setChildElement(packet.getChildElement().createCopy());
reply.setError(new PacketError(PacketError.Condition.not_authorized));
}
}
else if ("chat-settings".equals(name)) {
ChatSettingsManager chatSettingsManager = ChatSettingsManager.getInstance();
String key = iq.attributeValue("key");
String type = iq.attributeValue("type");
if (ModelUtil.hasLength(key)) {
chatSettingsManager.getChatSettingByKey(packet, workgroup, key);
}
else if (ModelUtil.hasLength(type)) {
try {
int typeInt = Integer.parseInt(type);
chatSettingsManager.getChatSettingsByType(packet, workgroup, typeInt);
}
catch (NumberFormatException e) {
// Bad type.
}
}
else {
chatSettingsManager.getAllChatSettings(packet, workgroup);
}
}
else if ("jabber:iq:private".equals(namespace)) {
// IQ private for agents global macro storage
getIQPrivate(packet);