aboutsummaryrefslogtreecommitdiffstats
path: root/root_commands.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-07-06 22:44:52 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-07-06 22:44:52 +0100
commit6c2404e051cb6a235f985797c149af0791f44bbd (patch)
tree7f690ac9089925e345df5d4922ae29a4c1207d62 /root_commands.c
parent006a84f999248d1bc1c1e36fa3437765d4bd1142 (diff)
First part of the handshake, including sending a file descriptor to the
IPC master.
Diffstat (limited to 'root_commands.c')
-rw-r--r--root_commands.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/root_commands.c b/root_commands.c
index 62fe1e79..5d84c6d4 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -104,7 +104,6 @@ static void cmd_account( irc_t *irc, char **cmd );
static void cmd_identify( irc_t *irc, char **cmd )
{
storage_status_t status;
- char *account_on[] = { "account", "on", NULL };
gboolean load = TRUE;
char *password = cmd[1];
@@ -157,8 +156,16 @@ static void cmd_identify( irc_t *irc, char **cmd )
irc->status |= USTATUS_IDENTIFIED;
irc_umode_set( irc, "+R", 1 );
irc_channel_auto_joins( irc, NULL );
- if( load && set_getbool( &irc->b->set, "auto_connect" ) )
- cmd_account( irc, account_on );
+
+ if( ipc_child_identify( irc ) )
+ {
+ if( load && set_getbool( &irc->b->set, "auto_connect" ) )
+ irc->login_source_id = b_timeout_add( 200,
+ cmd_identify_finish, irc );
+ }
+ else if( load && set_getbool( &irc->b->set, "auto_connect" ) )
+ cmd_identify_finish( irc, 0, 0 );
+
break;
case STORAGE_OTHER_ERROR:
default:
@@ -167,6 +174,16 @@ static void cmd_identify( irc_t *irc, char **cmd )
}
}
+gboolean cmd_identify_finish( gpointer data, gint fd, b_input_condition cond )
+{
+ char *account_on[] = { "account", "on", NULL };
+ irc_t *irc = data;
+
+ cmd_account( irc, account_on );
+
+ return FALSE;
+}
+
static void cmd_register( irc_t *irc, char **cmd )
{
if( global.conf->authmode == AUTHMODE_REGISTERED )
@@ -671,7 +688,7 @@ static void cmd_rename( irc_t *irc, char **cmd )
}
else if( iu == irc->user )
{
- irc_usermsg( irc, "Nick `%s' can't be changed", cmd[1] );
+ irc_usermsg( irc, "Use /nick to change your own nickname" );
}
else if( !nick_ok( cmd[2] ) )
{