Chats won't throw an error anymore when people keep looking to a room that has been closed. Instead, user will be informed that the room is unavailable. Added missing locale key source of errors in the log. Fixed wrong stored procedure, stating different arguments than in actual usage. Cleaned up weird idioms in xql files and chat api, moved many db operations into tcl api. Exploited cache (ns_cache) to retrieve quickly chat room information. Improved code quality a bit. Ported upstream some local modification, like prettifying of flags in chat room management and fix of double quoting in chat's javascript.