Allow user to specify how far in the past people connecting to the chat will see. This is important on Learn@WU because people joining the chat room later want to see the full conversation and before this was not settable from the UI. (Now defaults to 4 hours) Useful also when somebody accidentally refreshes the chat after the timewindow has passed.
Took this chance to ease a bit every future development: removed stored procedures slowing greatly any change on the data model in favor of plain sql statements. Incremented usage of cache. Removed duplicated database operation when managing transcripts. Fixed transcript name not being shown when deleting.
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.