waiting for WHY2_CHAT_CODE_USERNAME
This commit is contained in:
parent
6c53169f09
commit
4d64d73c07
@ -554,11 +554,24 @@ void *why2_communicate_thread(void *arg)
|
||||
goto deallocation;
|
||||
}
|
||||
|
||||
if ((raw = read_user(connection, &raw_ptr)) == NULL) //READ
|
||||
//KEEP READING UNTIL CODE ARRIVES
|
||||
char *code = NULL;
|
||||
why2_bool exiting_read = 0;
|
||||
do
|
||||
{
|
||||
force_exiting = 1; //FAILURE
|
||||
goto deallocation;
|
||||
}
|
||||
//DEALLOCATE
|
||||
why2_deallocate(code);
|
||||
|
||||
if ((raw = read_user(connection, &raw_ptr)) == NULL) //READ
|
||||
{
|
||||
force_exiting = 1; //FAILURE
|
||||
goto deallocation;
|
||||
}
|
||||
|
||||
//COMPARE CODE
|
||||
code = get_string_from_json_string(raw, "code");
|
||||
exiting_read = code != NULL && strcmp(code, WHY2_CHAT_CODE_USERNAME) == 0;
|
||||
} while (!exiting_read);
|
||||
|
||||
decoded_buffer = get_string_from_json_string(raw, "message"); //DECODE
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user