From 11ddd9c9b967fff979cd56cd65705a5bc9cc34f7 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Sat, 31 Aug 2024 16:50:16 +0200 Subject: [PATCH] defined and implemented why2_get_server_users_path --- src/chat/config.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/chat/config.c b/src/chat/config.c index 96cfac5..39977d0 100644 --- a/src/chat/config.c +++ b/src/chat/config.c @@ -113,7 +113,7 @@ void why2_chat_init_server_config(void) //CHECK FOR USER CONFIG char *user_pick_username = why2_chat_server_config("user_pick_username"); - char *config_path = why2_replace(WHY2_CONFIG_DIR "/" WHY2_CHAT_CONFIG_SERVER_USERS, "{USER}", getenv("USER")); + char *config_path = why2_get_server_users_path(); if (strcmp(user_pick_username, "true") == 0 && access(config_path, R_OK) != 0) { @@ -145,4 +145,9 @@ char *why2_chat_server_config(char *key) char *why2_chat_client_config(char *key) { return config(key, CLIENT); +} + +char *why2_get_server_users_path(void) +{ + return why2_replace(WHY2_CONFIG_DIR "/" WHY2_CHAT_CONFIG_SERVER_USERS, "{USER}", getenv("USER")); } \ No newline at end of file