summary refs log tree commit diff stats
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/cfgfiles.c11
-rw-r--r--src/common/outbound.c21
2 files changed, 24 insertions, 8 deletions
diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c
index fd037525..9aac5a4f 100644
--- a/src/common/cfgfiles.c
+++ b/src/common/cfgfiles.c
@@ -619,7 +619,7 @@ convert_with_fallback (const char *str, const char *fallback)
 void
 load_config (void)
 {
-	char *cfg, *sp;
+	char *cfg, *sp, *buf;
 	const char *username, *realname;
 	int res, val, i;
 #ifdef WIN32
@@ -754,7 +754,10 @@ load_config (void)
 		snprintf (prefs.hex_dcc_dir, sizeof (prefs.hex_dcc_dir), "%s\\Downloads", out);
 	}
 #else
-	snprintf (prefs.hex_dcc_dir, sizeof (prefs.hex_dcc_dir), "%s/downloads", get_xdir ());
+	if (g_get_user_special_dir(G_USER_DIRECTORY_DOWNLOAD))
+		strcpy (prefs.hex_dcc_dir, g_get_user_special_dir(G_USER_DIRECTORY_DOWNLOAD));
+	else
+		strcpy (prefs.hex_dcc_dir, g_build_filename (g_get_home_dir (), "Downloads", NULL));
 #endif
 	strcpy (prefs.hex_dnsprogram, "host");
 	strcpy (prefs.hex_gui_ulist_doubleclick, "QUERY %s");
@@ -834,6 +837,10 @@ load_config (void)
 
 		g_mkdir (prefs.hex_dcc_dir, 0700);
 		g_mkdir (prefs.hex_dcc_completed_dir, 0700);
+
+		buf = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "addons", get_xdir ());
+		g_mkdir (buf, 0700);
+		g_free (buf);
 	}
 	if (prefs.hex_gui_win_height < 138)
 		prefs.hex_gui_win_height = 138;
diff --git a/src/common/outbound.c b/src/common/outbound.c
index cc2d0e3e..c146c2ac 100644
--- a/src/common/outbound.c
+++ b/src/common/outbound.c
@@ -2348,17 +2348,26 @@ static int
 cmd_join (struct session *sess, char *tbuf, char *word[], char *word_eol[])
 {
 	char *chan = word[2];
+	session *sess_find;
 	if (*chan)
 	{
 		char *po, *pass = word[3];
-		sess->server->p_join (sess->server, chan, pass);
-		if (sess->channel[0] == 0 && sess->waitchannel[0])
+
+		sess_find = find_channel (sess->server, chan);
+		if (!sess_find)
 		{
-			po = strchr (chan, ',');
-			if (po)
-				*po = 0;
-			safe_strcpy (sess->waitchannel, chan, CHANLEN);
+			sess->server->p_join (sess->server, chan, pass);
+			if (sess->channel[0] == 0 && sess->waitchannel[0])
+			{
+				po = strchr (chan, ',');
+				if (po)
+					*po = 0;
+				safe_strcpy (sess->waitchannel, chan, CHANLEN);
+			}
 		}
+		else
+			fe_ctrl_gui (sess_find, 2, 0);	/* bring-to-front */
+		
 		return TRUE;
 	}
 	return FALSE;