aboutsummaryrefslogtreecommitdiffstats
path: root/root_commands.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2006-04-03 23:34:45 +0200
committerWilmer van der Gaast <wilmer@gaast.net>2006-04-03 23:34:45 +0200
commitf8de26f98e3c38d3deacb674e533c588e6b48548 (patch)
treea2b6881fc3a55ce2f671c7c7d671aea2364a07d1 /root_commands.c
parente6d6047924c7f6b70d51398a617ada03ac1850de (diff)
Added "add -tmp" command, which you can use to temporary add a buddy to your
list, like the handle_unknown=add setting does.
Diffstat (limited to 'root_commands.c')
-rw-r--r--root_commands.c14
1 files changed, 13 insertions, 1 deletions
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 );