From 6adf4a391a0cccbdd86599adc4c3d879374633a7 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 28 Aug 2024 12:40:30 +0200 Subject: [PATCH] removed stupid get_version im so fucking dumb... i was sending latest why2 verison instead of current --- src/chat/misc.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/chat/misc.c b/src/chat/misc.c index 242eb72..67e8735 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -447,24 +447,6 @@ unsigned long get_latest_id() return returning; } -char *get_version(void) -{ - //GET VERSION STRING FROM THE VERSIONS JSON - struct json_object *version_object; - char *version_file = why2_get_version(); - struct json_object *version_json = json_tokener_parse(version_file); - json_object_object_get_ex(version_json, "active", &version_object); - - //DUPLICATE version_object STRING (THE ORIGINAL WILL BE REMOVED BY json_object_put) - char *version = why2_strdup((char*) json_object_get_string(version_object)); - - //DEALLOCATION - why2_deallocate(version_file); - json_object_put(version_json); - - return version; -} - //GLOBAL void why2_send_socket(char *text, char *username, int socket) { @@ -669,17 +651,15 @@ void *why2_communicate_thread(void *arg) } else if (strcmp(decoded_buffer, WHY2_CHAT_CODE_VERSION) == 0) { //GET VERSION STRING FROM THE VERSIONS JSON - char *version = get_version(); - char *message = why2_malloc(strlen(WHY2_CHAT_CODE_VERSION_SERVER) + strlen(version) + 2); //ALLOCATE MESSAGE FOR CLIENT + char *message = why2_malloc(strlen(WHY2_CHAT_CODE_VERSION_SERVER) + strlen(WHY2_VERSION) + 2); //ALLOCATE MESSAGE FOR CLIENT - sprintf(message, WHY2_CHAT_CODE_VERSION_SERVER ";%s%c", version, '\0'); //CREATE THE MESSAGE + sprintf(message, WHY2_CHAT_CODE_VERSION_SERVER ";%s%c", WHY2_VERSION, '\0'); //CREATE THE MESSAGE //SEND send_socket_deallocate(message, why2_chat_server_config("server_username"), connection); //DEALLOCATION why2_deallocate(message); - why2_deallocate(version); } //IGNORE INVALID CODES, THE USER JUST GOT THEIR LOBOTOMY DONE