--- xchat-1.8.11/src/fe-gtk/fe-gtk.c 2002-12-03 05:08:02.000000000 -0200 +++ xchat-1.8.11-p1/src/fe-gtk/fe-gtk.c 2003-07-20 03:31:14.000000000 -0300 @@ -595,7 +595,50 @@ 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(); + } int