From f8de26f98e3c38d3deacb674e533c588e6b48548 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 3 Apr 2006 23:34:45 +0200 Subject: Added "add -tmp" command, which you can use to temporary add a buddy to your list, like the handle_unknown=add setting does. --- root_commands.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'root_commands.c') diff --git a/root_commands.c b/root_commands.c index 86f75922..0b5f4da5 100644 --- a/root_commands.c +++ b/root_commands.c @@ -349,6 +349,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] ) ) ) { @@ -378,7 +385,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 ); -- cgit v1.2.3