added stuff to allow for joining and leaving chatrooms
merged (read removed) some things from master