public void addUserToChannel(Client client, String channel){
        
        if (returnChannel(channel) == null){
            //log.writeLn("what happened");
            sendNotify(";There is no such channel as " + channel, client);
            
            // then maybe tell the user how to create it
            client.send("all Creating channel " + channel);
            
            // create channel
            //if (client.getLevel() < 2){
                //try {
                    createChannel(channel);
                    setChannelAdmin(client, channel);
                    addUserToChannel(client, channel);
                /*} catch (Exception e){
                    client.send("notify Channel;Could not create channel.");
                } */  
            //}
        } else {
            // check if the user is banned
            for (int i=0;i<returnChannel(channel).banned.size();i++){
                if (client.getName() == returnChannel(channel).banned.get(i)){
                    client.send("notify Banned;You are banned from the channel");
                    return;
                }
            }            
            
            // check if there is already a user with this nickname in the room
            for (int i=0;i<returnChannel(channel).channelClientList.size();i++){
                if (client.getNickname() == null ? returnChannel(channel).channelClientList.get(i).getNickname() == null : client.getNickname().equals(returnChannel(channel).channelClientList.get(i).getNickname())){
                    // they are already connected
                    client.send("notify " + channel+";You are already connected to this channel.");
                    return;
                }
            }
            
            
            send("createchan " + channel, client.getName());
            for (int i=0;i<channelList.size();i++){
                if (channelList.get(i).getChannelName().equals(channel)){
                    channelList.get(i).addUser(client);
                    try {
                        Thread.sleep(40);
                    } catch (InterruptedException ex) {
                        java.util.logging.Logger.getLogger(ServerThread.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    if (!"".equals(channelList.get(i).getTopic().trim())){
                        send("topic " + channel +  " Topic: " + channelList.get(i).getTopic(), client.getName());
                    }
                    
                    // check if the user is an admin
                    if (channelList.get(i).isAdmin(client.getName())){
                        
                    }
                    
                    
                    return;
                }
            }
            
        }
        
    }