comparison 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
comparison
equal deleted inserted replaced
1525:68580b6be895 1526:eefa0ae248d8
144 144
145 getbuf = fgets(buf, HBB_BLOCKSIZE, sfd); 145 getbuf = fgets(buf, HBB_BLOCKSIZE, sfd);
146 if (getbuf) { 146 if (getbuf) {
147 guint logflag; 147 guint logflag;
148 char *eol = buf; 148 char *eol = buf;
149 guint fifo_ignore = settings_opt_get_int("fifo_ignore");
149 150
150 // Strip trailing newlines 151 // Strip trailing newlines
151 for ( ; *eol ; eol++) 152 for ( ; *eol ; eol++)
152 ; 153 ;
153 if (eol > buf) 154 if (eol > buf)
157 158
158 if (settings_opt_get_int("fifo_hide_commands")) 159 if (settings_opt_get_int("fifo_hide_commands"))
159 logflag = LPRINT_LOG; 160 logflag = LPRINT_LOG;
160 else 161 else
161 logflag = LPRINT_LOGNORM; 162 logflag = LPRINT_LOGNORM;
162 scr_LogPrint(logflag, "Executing FIFO command: %s", buf); 163 scr_LogPrint(logflag, "%s FIFO command: %s",
163 if (process_command(buf, TRUE) == 255) 164 (fifo_ignore ? "Ignoring" : "Executing"), buf);
164 mcabber_set_terminate_ui(); 165 if (!fifo_ignore) {
166 if (process_command(buf, TRUE) == 255)
167 mcabber_set_terminate_ui();
168 }
165 } else { 169 } else {
166 if (feof(sfd)) 170 if (feof(sfd))
167 fifo_init(NULL); // Reopen the FIFO on EOF 171 fifo_init(NULL); // Reopen the FIFO on EOF
168 } 172 }
169 } 173 }