# HG changeset patch # User Mikael Berthe # Date 1222975460 -7200 # Node ID eefa0ae248d8ec730ee846e7c05d94828b16de8a # Parent 68580b6be8955c72cf7681a7adbd327e35decedc Add option "fifo_ignore" (Suggested by T. Glaser) This new option can be used for switching the FIFO on and off from within the session. diff -r 68580b6be895 -r eefa0ae248d8 mcabber/mcabberrc.example --- a/mcabber/mcabberrc.example Thu Oct 02 20:00:11 2008 +0200 +++ b/mcabber/mcabberrc.example Thu Oct 02 21:24:20 2008 +0200 @@ -234,10 +234,14 @@ # FIFO # mcabber can create a FIFO named pipe and listen to this pipe for commands. # Default: disabled. -# Set fifo_hide_commands to 1 if you don't want to see the FIFO commands +# Set 'fifo_hide_commands' to 1 if you don't want to see the FIFO commands # in the log window (they will still be written to the tracelog file). +# When FIFO is configured, you can turn it off and on in real time with +# the 'fifo_ignore' option (default: 0). When set to 1, the FIFO input is +# still read but it is discarded. #set fifo_name = ~/.mcabber/mcabber.fifo #set fifo_hide_commands = 0 +#set fifo_ignore = 0 # Traces logging # If you want advanced traces, please specify a file and a level here. diff -r 68580b6be895 -r eefa0ae248d8 mcabber/src/fifo.c --- a/mcabber/src/fifo.c Thu Oct 02 20:00:11 2008 +0200 +++ b/mcabber/src/fifo.c Thu Oct 02 21:24:20 2008 +0200 @@ -146,6 +146,7 @@ if (getbuf) { guint logflag; char *eol = buf; + guint fifo_ignore = settings_opt_get_int("fifo_ignore"); // Strip trailing newlines for ( ; *eol ; eol++) @@ -159,9 +160,12 @@ logflag = LPRINT_LOG; else logflag = LPRINT_LOGNORM; - scr_LogPrint(logflag, "Executing FIFO command: %s", buf); - if (process_command(buf, TRUE) == 255) - mcabber_set_terminate_ui(); + scr_LogPrint(logflag, "%s FIFO command: %s", + (fifo_ignore ? "Ignoring" : "Executing"), buf); + if (!fifo_ignore) { + if (process_command(buf, TRUE) == 255) + mcabber_set_terminate_ui(); + } } else { if (feof(sfd)) fifo_init(NULL); // Reopen the FIFO on EOF