diff options
Diffstat (limited to 'irc.c')
-rw-r--r-- | irc.c | 28 |
1 files changed, 24 insertions, 4 deletions
@@ -31,6 +31,7 @@ #include <sys/wait.h> static gboolean irc_userping( gpointer _irc, int fd, b_input_condition cond ); +static void irc_welcome( irc_t *irc ); GSList *irc_connection_list = NULL; @@ -786,10 +787,7 @@ void irc_login( irc_t *irc ) u->online = 1; irc_spawn( irc, u ); - irc_usermsg( irc, "Welcome to the BitlBee gateway!\n\nIf you've never used BitlBee before, please do read the help information using the \x02help\x02 command. Lots of FAQs are answered there." ); - #ifdef WITH_OTR - irc_usermsg( irc, "\nOTR users please note: Private key files are owned by the user BitlBee is running as." ); - #endif + irc_welcome( irc ); if( global.conf->runmode == RUNMODE_FORKDAEMON || global.conf->runmode == RUNMODE_DAEMON ) ipc_to_master_str( "CLIENT %s %s :%s\r\n", irc->host, irc->nick, irc->realname ); @@ -797,6 +795,28 @@ void irc_login( irc_t *irc ) irc->status |= USTATUS_LOGGED_IN; } +static void irc_welcome( irc_t *irc ) +{ + FILE *f; + + f = fopen( global.conf->welcomefile, "r" ); + if( !f ) + { + irc_usermsg( irc, "Welcome to the BitlBee gateway!\n\nIf you've never used BitlBee before, please do read the help information using the \x02help\x02 command. Lots of FAQs are answered there.\n\nOTR users please note: Private key files are owned by the user BitlBee is running as." ); + } + else + { + char linebuf[380]; + + while( fgets( linebuf, 380, f ) ) + { + irc_usermsg( irc, linebuf ); + } + + fclose( f ); + } +} + void irc_motd( irc_t *irc ) { int fd; |