rtoal/ktah — Issue #15: Automatic chat room creation
Author: rowedonalde
Created: 2011-11-01 09:14:44+00:00
State: open

If a user requests to join by URI a chat room that does not exist yet, chat-controller should create that room. I've inserted the preliminary code to do this. For some reason, though, this block of code in GET chat is broken:

```
if (typeof inbox[room] === undefined)
{
res.send( JSON.stringify({success: false}) );
}
else if (typeof inbox[room][nick] === undefined) //for some reason it still passes to here even if the room doesn't exist
{
res.send( JSON.stringify({success: false}) );
}
else
{
res.send( JSON.stringify({messages: inbox[room][nick].messages, success: true}) );
inbox[room][nick].messages = [];
inbox[room][nick].lastPing = time;
}
```