implemented why2_config_read in chat-misc

This commit is contained in:
Václav Šmejkal 2024-01-24 12:16:15 +01:00
parent c8bfaedd9d
commit 8f3a45f3ef
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -30,7 +30,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <why2/chat/config.h>
#include <why2/chat/flags.h>
#include <why2/chat/parser.h>
#include <why2/llist.h>
#include <why2/memory.h>
@ -305,7 +304,7 @@ void *why2_communicate_thread(void *arg)
//GET USERNAME
char *string_buffer = why2_replace(WHY2_CHAT_CONFIG_DIR "/" WHY2_CHAT_CONFIG_SERVER, "{USER}", getenv("USER"));
char *config_username = why2_yml_read(string_buffer, "user_pick_username");
char *config_username = why2_config_read(string_buffer, "user_pick_username");
if (config_username == NULL || strcmp(config_username, "true") == 0)
{
@ -318,7 +317,7 @@ void *why2_communicate_thread(void *arg)
}
why2_deallocate(string_buffer);
why2_deallocate(config_username);
why2_config_read_free(config_username);
void *buffer;
char *received = NULL;