Client logic for chatroom.