private String handleRequest(String line) {

        /*
         * Determine what the client sent us
         */
        Protocol.ProtocolToServer proto = Protocol.idServerProto(line);

        switch (proto) {
        case REQUEST_LOGIN:
            String username = line.split(" ")[1].trim();

            // handle the login request

            if (serverModel.isUserLoggedIn(username)) {
                // the person is already logged in
                return Protocol.CLIENT_ERROR_USERNAME_ALREADY_TAKEN + " "
                        + username;
            } else {
                // otherwise login
                serverModel.logUserIn(username, client);
                clientUsername = username;

                // notify everyone we've logged in
                for (String toUser : serverModel.getUsers()) {
                    sendToUser(toUser,
                            Protocol.CLIENT_USERS_LOGGED_IN_NOTIFICATION
                                    + " > " + serverModel.listOfUsers());
                }

                // notify the user that he's logged in
                return Protocol.CLIENT_THIS_USER_LOGGED_IN_NOTIFICATION + " > "
                        + clientUsername;
            }

        case LOG_OFF:
            // log him off
            serverModel.logUserOff(clientUsername);

            // give everyone a list of current online users
            for (String toUser : serverModel.getUsers()) {
                sendToUser(toUser, Protocol.CLIENT_USERS_LOGGED_IN_NOTIFICATION
                        + " > " + serverModel.listOfUsers());
            }

            // return null to drop the connection
            return null;

        case SEND_CHAT_MESSAGE:
            String toUser = line.split(" ")[1].trim();
            String message = line.split(">")[1].trim();

            // don't send a chat to someone not logged in
            if (!serverModel.isUserLoggedIn(toUser)) {
                return Protocol.CLIENT_ERROR_USERNAME_DOES_NOT_EXIST + " "
                        + toUser;
            }

            // send the message to the touser
            sendToUser(toUser, Protocol.CLIENT_RECEIVED_CHAT_MESSAGE + " "
                    + clientUsername + " >" + message);

            // tell the client his message was successfully sent
            return Protocol.CLIENT_MESSAGE_SUCCESSFULLY_SENT + " " + toUser
                    + " >" + message;

        case SET_TYPING_STATUS:
            String toUsr = line.split(" ")[1].trim();
            String status = line.split(">")[1].trim();

            // don't send our status to someone not logged in
            if (!serverModel.isUserLoggedIn(toUsr)) {
                return Protocol.CLIENT_ERROR_USERNAME_DOES_NOT_EXIST + " "
                        + toUsr;
            }

            // send the status to the other guy
            sendToUser(toUsr, Protocol.CLIENT_RECEIVED_TYPING_STATUS + " "
                    + clientUsername + " > " + status);

            return "";
        }
        return "";
    }