--- xchat-2.0.3/src/fe-gtk/fe-gtk.c 2003-06-18 04:35:38.000000000 -0300 +++ xchat-2.0.3-p1/src/fe-gtk/fe-gtk.c 2003-07-20 13:39:43.000000000 -0300 @@ -536,9 +536,52 @@ void fe_beep (void) { - gdk_beep (); -} + FILE *som = NULL,*config = NULL; + char *home = getenv("HOME"); + char path[255],confpath[255],buffer[255]; + int opt = 0; + + strcpy(confpath,home); + strcat(confpath,"/.xchat/beep.conf"); + + config = fopen(confpath,"r"); + + if (config == NULL) { + gdk_beep(); + return; + } + + fscanf(config," %[^\n]",buffer); + + while (!feof(config)) { + if (buffer[0] != '#') { + sscanf(buffer,"%d",&opt); + } + fscanf(config," %[^\n]",buffer); + } + fclose(config); + + if (opt == 0) { + gdk_beep(); + return; + } + + strcpy(path,home); + strcat(path,"/.xchat/beep.wav"); + + som = fopen(path,"r"); + + if (som != NULL) { + if (opt == 2) + gdk_beep(); + system("play ~/.xchat/beep.wav"); + fclose(som); + } + else + gdk_beep(); +} + typedef struct { session *sess; char *sstr;