defined and implemented why2_get_server_users_path

This commit is contained in:
Václav Šmejkal 2024-08-31 16:50:16 +02:00
parent 48412cae73
commit 11ddd9c9b9
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -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"));
}