diff --git a/include/chat/flags.h b/include/chat/flags.h index c9529da..e0c3853 100644 --- a/include/chat/flags.h +++ b/include/chat/flags.h @@ -32,9 +32,6 @@ extern "C" { #define WHY2_INVALID_POINTER (void*) 0xffffffffffffffff -#define WHY2_MAX_USERNAME_LENGTH 20 //MAXIMAL USERNAME LENGTH -#define WHY2_MIN_USERNAME_LENGTH 4 //MINIMAL USERNAME LENGTH - //CODES #define WHY2_CHAT_CODE_ACCEPT_MESSAGES "code_000" #define WHY2_CHAT_CODE_PICK_USERNAME "code_001" diff --git a/src/chat/misc.c b/src/chat/misc.c index d429dcc..0bddda6 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -485,7 +485,7 @@ void *why2_communicate_thread(void *arg) decoded_buffer = get_string_from_json_string(raw, "message"); //DECODE - invalid_username = decoded_buffer == NULL || (strlen(decoded_buffer) > WHY2_MAX_USERNAME_LENGTH) || (strlen(decoded_buffer) < WHY2_MIN_USERNAME_LENGTH) || (!check_username(decoded_buffer)); //CHECK FOR USERNAMES LONGER THAN 20 CHARACTERS + invalid_username = decoded_buffer == NULL || (strlen(decoded_buffer) > (unsigned long) server_config_int("max_username_length")) || (strlen(decoded_buffer) < (unsigned long) server_config_int("min_username_length")) || (!check_username(decoded_buffer)); //CHECK FOR USERNAMES LONGER THAN 20 CHARACTERS username = decoded_buffer;