summary refs log tree commit diff stats
path: root/src/common
diff options
context:
space:
mode:
authorBerke Viktor <bviktor@hexchat.org>2013-04-14 11:56:50 +0200
committerBerke Viktor <bviktor@hexchat.org>2013-04-14 11:56:50 +0200
commitea0479998a0d44eb2a02c5ec18a692b17aa53274 (patch)
treeb951022af72d1a6fa0f84d2958075be1702374e7 /src/common
parent9272eb43252e8956df6eedd2c96c718b247bca94 (diff)
Use bundled beep file for beep alerts
Diffstat (limited to 'src/common')
-rw-r--r--src/common/cfgfiles.c2
-rw-r--r--src/common/ctcp.c2
-rw-r--r--src/common/outbound.c2
-rw-r--r--src/common/text.c10
-rw-r--r--src/common/text.h2
5 files changed, 9 insertions, 9 deletions
diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c
index 4b8a4c8d..712f2bfa 100644
--- a/src/common/cfgfiles.c
+++ b/src/common/cfgfiles.c
@@ -843,7 +843,7 @@ load_config (void)
 			g_free (buf);
 
 			buf = g_build_filename (get_xdir (), "sounds", "beep.wav", NULL);
-#ifdef WIN32
+#ifdef WIN32	/* keep this in sync with fe-gtk.c! */
 			beepsrc = g_file_new_for_path (HEXCHATSHAREDIR G_DIR_SEPARATOR_S "share" G_DIR_SEPARATOR_S "beep.wav");
 #else
 			beepsrc = g_file_new_for_path (HEXCHATSHAREDIR G_DIR_SEPARATOR_S "hexchat" G_DIR_SEPARATOR_S "beep.wav");
diff --git a/src/common/ctcp.c b/src/common/ctcp.c
index ebfb604d..487003a8 100644
--- a/src/common/ctcp.c
+++ b/src/common/ctcp.c
@@ -175,7 +175,7 @@ ctcp_handle (session *sess, char *to, char *nick, char *ip,
 #else
 			if (strchr (word[5], '/') == NULL)
 #endif
-				sound_play (word[5], TRUE);
+				sound_play (word[5], TRUE, FALSE);
 			return;
 		}
 	}
diff --git a/src/common/outbound.c b/src/common/outbound.c
index d6ce1488..00ba4a86 100644
--- a/src/common/outbound.c
+++ b/src/common/outbound.c
@@ -3161,7 +3161,7 @@ cmd_splay (struct session *sess, char *tbuf, char *word[], char *word_eol[])
 {
 	if (*word[2])
 	{
-		sound_play (word[2], FALSE);
+		sound_play (word[2], FALSE, FALSE);
 		return TRUE;
 	}
 
diff --git a/src/common/text.c b/src/common/text.c
index 946ac542..3a61eecc 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -2218,7 +2218,7 @@ sound_find_command (void)
 }
 
 void
-sound_play (const char *file, gboolean quiet)
+sound_play (const char *file, gboolean quiet, gboolean hexchat_beep)
 {
 	char *buf;
 	char *wavfile;
@@ -2233,10 +2233,10 @@ sound_play (const char *file, gboolean quiet)
 		return;
 
 #ifdef WIN32
-	/* check for fullpath */
-	if (file[0] == '\\' || (((file[0] >= 'A' && file[0] <= 'Z') || (file[0] >= 'a' && file[0] <= 'z')) && file[1] == ':'))
+	/* check for fullpath; also use full path if hexchat_beep is TRUE, which should *only* happen when invoked by fe_beep() */
+	if (hexchat_beep || file[0] == '\\' || (((file[0] >= 'A' && file[0] <= 'Z') || (file[0] >= 'a' && file[0] <= 'z')) && file[1] == ':'))
 #else
-	if (file[0] == '/')
+	if (hexchat_beep || file[0] == '/')
 #endif
 	{
 		wavfile = g_strdup (file);
@@ -2308,7 +2308,7 @@ void
 sound_play_event (int i)
 {
 	if (sound_files[i])
-		sound_play (sound_files[i], FALSE);
+		sound_play (sound_files[i], FALSE, FALSE);
 }
 
 static void
diff --git a/src/common/text.h b/src/common/text.h
index 52cc8ea9..4d7bbb38 100644
--- a/src/common/text.h
+++ b/src/common/text.h
@@ -53,7 +53,7 @@ int get_stamp_str (char *fmt, time_t tim, char **ret);
 void format_event (session *sess, int index, char **args, char *o, int sizeofo, unsigned int stripcolor_args);
 char *text_find_format_string (char *name);
  
-void sound_play (const char *file, gboolean quiet);
+void sound_play (const char *file, gboolean quiet, gboolean hexchat_beep);
 void sound_play_event (int i);
 void sound_beep (session *);
 void sound_load ();