Changeset 22d41a2


Ignore:
Timestamp:
2005-11-18T19:10:20Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
d908e3a
Parents:
517ecc4
Message:

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.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • irc.c

    r517ecc4 r22d41a2  
    931931}
    932932
    933 void irc_write_all( char *format, ... )
     933void irc_write_all( int now, char *format, ... )
    934934{
    935935        va_list params;
    936936        GSList *temp;   
    937 
     937       
    938938        va_start( params, format );
    939 
     939       
    940940        temp = irc_connection_list;
    941         while( temp!=NULL ) {
     941        while( temp != NULL )
     942        {
     943                irc_t *irc = temp->data;
     944               
     945                if( now )
     946                {
     947                        g_free( irc->sendbuffer );
     948                        irc->sendbuffer = g_strdup( "\r\n" );
     949                }
    942950                irc_vawrite( temp->data, format, params );
     951                if( now )
     952                {
     953                        bitlbee_io_current_client_write( irc->io_channel, G_IO_OUT, irc );
     954                }
    943955                temp = temp->next;
    944956        }
    945 
     957       
    946958        va_end( params );
    947959        return;
  • irc.h

    r517ecc4 r22d41a2  
    118118void irc_vawrite( irc_t *irc, char *format, va_list params );
    119119void irc_write( irc_t *irc, char *format, ... );
    120 void irc_write_all( char *format, ... );
     120void irc_write_all( int now, char *format, ... );
    121121void irc_reply( irc_t *irc, int code, char *format, ... );
    122122G_MODULE_EXPORT int irc_usermsg( irc_t *irc, char *format, ... );
  • log.c

    r517ecc4 r22d41a2  
    134134static void log_irc(int level, char *message) {
    135135        if(level==LOGLVL_ERROR)
    136                 irc_write_all("ERROR :Error: %s", message);
     136                irc_write_all(1, "ERROR :Error: %s", message);
    137137        if(level==LOGLVL_WARNING)
    138                 irc_write_all("ERROR :Warning: %s", message);
     138                irc_write_all(0, "ERROR :Warning: %s", message);
    139139        if(level==LOGLVL_INFO)
    140                 irc_write_all("ERROR :Informational: %s", message);     
     140                irc_write_all(0, "ERROR :Informational: %s", message); 
    141141#ifdef DEBUG
    142142        if(level==LOGLVL_DEBUG)
    143                 irc_write_all("ERROR :Debug: %s", message);     
     143                irc_write_all(0, "ERROR :Debug: %s", message); 
    144144#endif 
    145145
Note: See TracChangeset for help on using the changeset viewer.