sending WHY2_CHAT_CODE_PICK_USERNAME signal to client at connect

This commit is contained in:
Václav Šmejkal 2023-05-02 18:55:21 +02:00
parent d25ca16f4e
commit 037521b871
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -28,6 +28,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <json-c/json.h> #include <json-c/json.h>
#include <why2/chat/config.h>
#include <why2/chat/flags.h> #include <why2/chat/flags.h>
#include <why2/llist.h> #include <why2/llist.h>
#include <why2/memory.h> #include <why2/memory.h>
@ -298,6 +299,9 @@ void *why2_communicate_thread(void *arg)
why2_list_push(&connection_list, &node, sizeof(node)); //ADD TO LIST why2_list_push(&connection_list, &node, sizeof(node)); //ADD TO LIST
printf("User connected.\t\t%d\n", connection); printf("User connected.\t\t%d\n", connection);
//GET USERNAME //TODO: Use config
why2_send_socket(WHY2_CHAT_CODE_PICK_USERNAME, "server", connection);
void *buffer; void *buffer;
char *received = NULL; char *received = NULL;
char *raw = why2_strdup(""); char *raw = why2_strdup("");