def cmd_join_channel(message, user):
    channelName = message.optionTags['channel']
    
    if channelName not in Channel._channelList:
        newChannel = Channel(channelName)
    
    newChannel.subscribe(user)        
def cmd_get_channels(message, user):
    nameString = ';'.join(Channel.name_list())
    
    optionMap = dict(identifier = message.optionTags['id'],
                     messageType = MessageType.RESPONSE,
                     command = '',
                     channel = '',
                     user = '')
    
    messageMap = dict(message = nameString)
    
    newMsg = Message(xml_options(optionMap), xml_message(messageMap))
    user.send(newMsg)