aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2005-11-18 20:10:20 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2005-11-18 20:10:20 +0100
commit22d41a26f53527adacc5b314fcdaea0c46a7723d (patch)
treeb4c08cf9ab6978abc4e62905e5ba8485db9da355
parent517ecc45fde83e3b13352fbff5eaa8755296dc7c (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.c22
-rw-r--r--irc.h2
-rw-r--r--log.c8
3 files changed, 22 insertions, 10 deletions
diff --git a/irc.c b/irc.c
index a716fe9e..60fe77f8 100644
--- a/irc.c
+++ b/irc.c
@@ -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;
}
diff --git a/irc.h b/irc.h
index 6f319f35..86aaec5e 100644
--- a/irc.h
+++ b/irc.h
@@ -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 );
diff --git a/log.c b/log.c
index 0ee0a987..ad39d775 100644
--- a/log.c
+++ b/log.c
@@ -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;