implemented max/min username
This commit is contained in:
parent
c2b9c7c57a
commit
fd68b0d01a
@ -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"
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user