checking for WHY2_CHAT_CODE_ACCEPT_MESSAGES from client

it was using the first received message
This commit is contained in:
Václav Šmejkal 2025-01-31 14:49:37 +01:00
parent 15e36f5919
commit 07eb596180
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

@ -962,6 +962,8 @@ void *why2_listen_server(void *socket)
if (server_uname == NULL) //GET SERVER USERNAME
{
if (code == NULL || strcmp(code, WHY2_CHAT_CODE_ACCEPT_MESSAGES) != 0) goto deallocation;
server_uname = why2_strdup(username); //GET USERNAME
//GET INFO
@ -1097,13 +1099,14 @@ void *why2_listen_server(void *socket)
printf("\n\n%s%s: %s\n\n", WHY2_CLEAR_AND_GO_UP, username, message);
}
if (!exiting && !continuing)
{
printf(">>> ");
fflush(stdout);
}
deallocation:
//DEALLOCATION
why2_deallocate(read);
why2_deallocate(username);