diff mcabber/src/fifo.c @ 1526:eefa0ae248d8

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.
author Mikael Berthe <mikael@lilotux.net>
date Thu, 02 Oct 2008 21:24:20 +0200
parents a8eb9aba2ed2
children 8c0237c8c186
line wrap: on
line diff
--- 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