diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2005-11-18 20:10:20 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2005-11-18 20:10:20 +0100 | 
| commit | 22d41a26f53527adacc5b314fcdaea0c46a7723d (patch) | |
| tree | b4c08cf9ab6978abc4e62905e5ba8485db9da355 | |
| parent | 517ecc45fde83e3b13352fbff5eaa8755296dc7c (diff) | |
Quit messages should appear again, at least on crashes. (And when running in inetd mode.)
The logging system needs some more work to complete this, maybe.
| -rw-r--r-- | irc.c | 22 | ||||
| -rw-r--r-- | irc.h | 2 | ||||
| -rw-r--r-- | log.c | 8 | 
3 files changed, 22 insertions, 10 deletions
| @@ -930,19 +930,31 @@ void irc_vawrite( irc_t *irc, char *format, va_list params )  	return;  } -void irc_write_all( char *format, ... ) +void irc_write_all( int now, char *format, ... )  {  	va_list params;  	GSList *temp;	 - +	  	va_start( params, format ); - +	  	temp = irc_connection_list; -	while( temp!=NULL ) { +	while( temp != NULL ) +	{ +		irc_t *irc = temp->data; +		 +		if( now ) +		{ +			g_free( irc->sendbuffer ); +			irc->sendbuffer = g_strdup( "\r\n" ); +		}  		irc_vawrite( temp->data, format, params ); +		if( now ) +		{ +			bitlbee_io_current_client_write( irc->io_channel, G_IO_OUT, irc ); +		}  		temp = temp->next;  	} - +	  	va_end( params );  	return;  }  @@ -117,7 +117,7 @@ int irc_process_line( irc_t *irc, char *line );  void irc_vawrite( irc_t *irc, char *format, va_list params );  void irc_write( irc_t *irc, char *format, ... ); -void irc_write_all( char *format, ... ); +void irc_write_all( int now, char *format, ... );  void irc_reply( irc_t *irc, int code, char *format, ... );  G_MODULE_EXPORT int irc_usermsg( irc_t *irc, char *format, ... );  char **irc_tokenize( char *buffer ); @@ -133,14 +133,14 @@ static void log_null(int level, char *message) {  static void log_irc(int level, char *message) {  	if(level==LOGLVL_ERROR) -		irc_write_all("ERROR :Error: %s", message); +		irc_write_all(1, "ERROR :Error: %s", message);  	if(level==LOGLVL_WARNING) -		irc_write_all("ERROR :Warning: %s", message); +		irc_write_all(0, "ERROR :Warning: %s", message);  	if(level==LOGLVL_INFO) -		irc_write_all("ERROR :Informational: %s", message);	 +		irc_write_all(0, "ERROR :Informational: %s", message);	  #ifdef DEBUG  	if(level==LOGLVL_DEBUG) -		irc_write_all("ERROR :Debug: %s", message);	 +		irc_write_all(0, "ERROR :Debug: %s", message);	  #endif	  	return; | 
