aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;