add XDG support to log/modules/fe-text

- title
- fixed some comments refering to ~/.irssi
This commit is contained in:
altffour 2021-01-06 19:37:33 +03:00
commit a7e91f0ef2
No known key found for this signature in database
GPG key ID: B4ADFA86EDF5CCE9
3 changed files with 9 additions and 3 deletions

View file

@ -111,7 +111,10 @@ void log_away_init(void)
away_filepos = 0;
away_msgs = 0;
awaylog_file = g_strconcat(get_irssi_dir(), "/away.log", NULL);
if (is_xdg_supported())
awaylog_file = g_build_filename(g_get_user_cache_dir(), "irssi", "away.log", NULL);
else
awaylog_file = g_strconcat(get_irssi_dir(), "/away.log", NULL);
settings_add_str("log", "awaylog_file", awaylog_file);
g_free(awaylog_file);
settings_add_level("log", "awaylog_level", "msgs hilight");

View file

@ -115,7 +115,10 @@ static GModule *module_open(const char *name, int *found)
path = g_strdup(name);
else {
/* first try from home dir */
str = g_strdup_printf("%s/modules", get_irssi_dir());
if (is_xdg_supported())
str = g_build_filename(g_get_user_data_dir(), "irssi", "modules", NULL);
else
str = g_strdup_printf("%s/modules", get_irssi_dir());
path = g_module_build_path(str, name);
g_free(str);

View file

@ -281,7 +281,7 @@ static void check_files(void)
struct stat statbuf;
if (stat(get_irssi_dir(), &statbuf) != 0) {
/* ~/.irssi doesn't exist, first time running irssi */
/* irssi config folder doesn't exist, first time running irssi */
display_firsttimer = TRUE;
}
}