diff options
Diffstat (limited to 'root_commands.c')
-rw-r--r-- | root_commands.c | 52 |
1 files changed, 36 insertions, 16 deletions
diff --git a/root_commands.c b/root_commands.c index 36eec8c3..0e12e9ab 100644 --- a/root_commands.c +++ b/root_commands.c @@ -56,6 +56,17 @@ void root_command_string( irc_t *irc, user_t *u, char *command, int flags ) cmd[k++] = s; s --; } + else + { + break; + } + } + else if( *s == '\\' && ( ( !q && s[1] ) || ( q && q == s[1] ) ) ) + { + char *cpy; + + for( cpy = s; *cpy; cpy ++ ) + cpy[0] = cpy[1]; } else if( *s == q ) { @@ -244,6 +255,9 @@ static void cmd_account( irc_t *irc, char **cmd ) { int i = 0; + if( strchr( irc->umode, 'b' ) ) + irc_usermsg( irc, "Account list:" ); + for( a = irc->accounts; a; a = a->next ) { char *con; @@ -346,6 +360,13 @@ static void cmd_account( irc_t *irc, char **cmd ) static void cmd_add( irc_t *irc, char **cmd ) { account_t *a; + int add_for_real = 1; + + if( g_strcasecmp( cmd[1], "-tmp" ) == 0 ) + { + add_for_real = 0; + cmd ++; /* So evil... :-D */ + } if( !( a = account_get( irc, cmd[1] ) ) ) { @@ -375,7 +396,12 @@ static void cmd_add( irc_t *irc, char **cmd ) nick_set( irc, cmd[2], a->gc->prpl, cmd[3] ); } } - a->gc->prpl->add_buddy( a->gc, cmd[2] ); + + /* By making this optional, you can talk to people without having to + add them to your *real* (server-side) contact list. */ + if( add_for_real ) + a->gc->prpl->add_buddy( a->gc, cmd[2] ); + add_buddy( a->gc, NULL, cmd[2], cmd[2] ); irc_usermsg( irc, "User `%s' added to your contact list as `%s'", cmd[2], user_findhandle( a->gc, cmd[2] )->nick ); @@ -491,7 +517,7 @@ static void cmd_block( irc_t *irc, char **cmd ) if( strchr( irc->umode, 'b' ) != NULL ) format = "%s\t%s"; else - format = "%-32.32 %-16.16s"; + format = "%-32.32s %-16.16s"; irc_usermsg( irc, format, "Handle", "Nickname" ); for( l = a->gc->deny; l; l = l->next ) @@ -531,9 +557,9 @@ static void cmd_block( irc_t *irc, char **cmd ) } else { - gc->prpl->rem_permit( gc, cmd[2] ); - gc->prpl->add_deny( gc, cmd[2] ); - irc_usermsg( irc, "Buddy `%s' moved from your permit- to your deny-list", cmd[2] ); + bim_rem_allow( gc, cmd[2] ); + bim_add_block( gc, cmd[2] ); + irc_usermsg( irc, "Buddy `%s' moved from your allow- to your block-list", cmd[2] ); } } @@ -550,7 +576,7 @@ static void cmd_allow( irc_t *irc, char **cmd ) if( strchr( irc->umode, 'b' ) != NULL ) format = "%s\t%s"; else - format = "%-32.32 %-16.16s"; + format = "%-32.32s %-16.16s"; irc_usermsg( irc, format, "Handle", "Nickname" ); for( l = a->gc->deny; l; l = l->next ) @@ -590,10 +616,10 @@ static void cmd_allow( irc_t *irc, char **cmd ) } else { - gc->prpl->rem_deny( gc, cmd[2] ); - gc->prpl->add_permit( gc, cmd[2] ); + bim_rem_block( gc, cmd[2] ); + bim_add_allow( gc, cmd[2] ); - irc_usermsg( irc, "Buddy `%s' moved from your deny- to your permit-list", cmd[2] ); + irc_usermsg( irc, "Buddy `%s' moved from your block- to your allow-list", cmd[2] ); } } @@ -752,15 +778,9 @@ static void cmd_nick( irc_t *irc, char **cmd ) } else { - char utf8[1024]; - irc_usermsg( irc, "Setting your name to `%s'", cmd[2] ); - if( g_strncasecmp( set_getstr( irc, "charset" ), "none", 4 ) != 0 && - do_iconv( set_getstr( irc, "charset" ), "UTF-8", cmd[2], utf8, 0, 1024 ) != -1 ) - a->gc->prpl->set_info( a->gc, utf8 ); - else - a->gc->prpl->set_info( a->gc, cmd[2] ); + a->gc->prpl->set_info( a->gc, cmd[2] ); } } |