Changeset 9893da3


Ignore:
Timestamp:
2010-05-03T23:55:33Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
eb50495
Parents:
0d4a068
Message:

Add irc_channel_printf() for slightly saner root messages from a random
channel.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • irc.h

    r0d4a068 r9893da3  
    197197int irc_channel_set_topic( irc_channel_t *ic, const char *topic, const irc_user_t *who );
    198198void irc_channel_user_set_mode( irc_channel_t *ic, irc_user_t *iu, irc_channel_user_flags_t flags );
     199void irc_channel_printf( irc_channel_t *ic, char *format, ... );
    199200gboolean irc_channel_name_ok( const char *name );
    200201
  • irc_channel.c

    r0d4a068 r9893da3  
    173173       
    174174        icu->flags = flags;
     175}
     176
     177void irc_channel_printf( irc_channel_t *ic, char *format, ... )
     178{
     179        va_list params;
     180        char *text;
     181       
     182        va_start( params, format );
     183        text = g_strdup_vprintf( format, params );
     184        va_end( params );
     185       
     186        irc_send_msg( ic->irc->root, "PRIVMSG", ic->name, text, NULL );
     187        g_free( text );
    175188}
    176189
     
    213226                else
    214227                {
    215                         irc_send_msg_f( irc->root, "PRIVMSG", ic->name,
    216                                         "User does not exist: %s", to );
     228                        irc_channel_printf( ic, "User does not exist: %s", to );
    217229                }
    218230        }
Note: See TracChangeset for help on using the changeset viewer.