diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-26 22:39:08 -0400 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-26 22:39:08 -0400 |
commit | 4be823968d7f4cb1d11e4f6dda50ef606a0fd7b0 (patch) | |
tree | 09ddd4ba6099791125506b54cf94f7bd08d4ee2c /irc.c | |
parent | ebaebfe35c82460581fa6db518d8848996c9a0f4 (diff) |
Simple IRC channel interface, use it to represent the control channel.
Diffstat (limited to 'irc.c')
-rw-r--r-- | irc.c | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -585,7 +585,39 @@ int irc_check_login( irc_t *irc ) } else { + irc_channel_t *ic; + irc_user_t *iu = irc->user; + + irc->user = irc_user_new( irc, iu->nick ); + irc->user->user = iu->user; + irc->user->fullname = iu->fullname; + g_free( iu->nick ); + g_free( iu ); + + irc->umode[0] = '\0'; + /*irc_umode_set( irc, "+" UMODE, 1 );*/ + + if( global.conf->runmode == RUNMODE_FORKDAEMON || global.conf->runmode == RUNMODE_DAEMON ) + ipc_to_master_str( "CLIENT %s %s :%s\r\n", irc->user->host, irc->user->nick, irc->user->fullname ); + + irc->status |= USTATUS_LOGGED_IN; + + /* This is for bug #209 (use PASS to identify to NickServ). */ + if( irc->password != NULL ) + { + char *send_cmd[] = { "identify", g_strdup( irc->password ), NULL }; + + /*irc_setpass( irc, NULL );*/ + /*root_command( irc, send_cmd );*/ + g_free( send_cmd[1] ); + } + irc_send_login( irc ); + + ic = irc_channel_new( irc, ROOT_CHAN ); + irc_channel_set_topic( ic, CONTROL_TOPIC ); + irc_channel_add_user( ic, irc->user ); + return 1; } } |