aboutsummaryrefslogtreecommitdiffstats
path: root/root_commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'root_commands.c')
-rw-r--r--root_commands.c42
1 files changed, 39 insertions, 3 deletions
diff --git a/root_commands.c b/root_commands.c
index a46e0225..77f40060 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -1,7 +1,7 @@
/********************************************************************\
* BitlBee -- An IRC to other IM-networks gateway *
* *
- * Copyright 2002-2010 Wilmer van der Gaast and others *
+ * Copyright 2002-2013 Wilmer van der Gaast and others *
\********************************************************************/
/* User manager (root) commands */
@@ -552,8 +552,7 @@ static void cmd_account( irc_t *irc, char **cmd )
g_strcasecmp( cmd[1], "del" ) == 0 ||
( a = account_get( irc->b, cmd[1] ) ) == NULL )
{
- irc_rootmsg( irc, "Could not find account `%s'. Note that the syntax "
- "of the account command changed, see \x02help account\x02.", cmd[1] );
+ irc_rootmsg( irc, "Could not find account `%s'.", cmd[1] );
return;
}
@@ -680,6 +679,7 @@ static void cmd_add( irc_t *irc, char **cmd )
{
account_t *a;
int add_on_server = 1;
+ char *handle = NULL, *s;
if( g_strcasecmp( cmd[1], "-tmp" ) == 0 )
{
@@ -717,6 +717,18 @@ static void cmd_add( irc_t *irc, char **cmd )
}
}
+ if( ( a->flags & ACC_FLAG_HANDLE_DOMAINS ) && cmd[2][0] != '_' &&
+ ( !( s = strchr( cmd[2], '@' ) ) || s[1] == '\0' ) )
+ {
+ /* If there's no @ or it's the last char, append the user's
+ domain name now. Exclude handles starting with a _ so
+ adding _xmlconsole will keep working. */
+ if( s )
+ *s = '\0';
+ if( ( s = strchr( a->user, '@' ) ) )
+ cmd[2] = handle = g_strconcat( cmd[2], s, NULL );
+ }
+
if( add_on_server )
{
irc_channel_t *ic;
@@ -746,6 +758,7 @@ static void cmd_add( irc_t *irc, char **cmd )
"to contact `%s'", iu->nick, cmd[2] );
}
+ g_free( handle );
}
static void cmd_remove( irc_t *irc, char **cmd )
@@ -1291,6 +1304,29 @@ static void cmd_group( irc_t *irc, char **cmd )
}
irc_rootmsg( irc, "End of group list" );
}
+ else if( g_strncasecmp(cmd[1], "info", len ) == 0 )
+ {
+ bee_group_t *bg;
+ int n = 0;
+
+ MIN_ARGS(2);
+ bg = bee_group_by_name( irc->b, cmd[2], FALSE );
+
+ if( bg )
+ {
+ if( strchr(irc->umode, 'b') )
+ irc_rootmsg( irc, "Members of %s:", cmd[2] );
+ for( l = irc->b->users; l; l = l->next )
+ {
+ bee_user_t *bu = l->data;
+ if( bu->group == bg )
+ irc_rootmsg( irc, "%d. %s", n ++, bu->nick ? : bu->handle );
+ }
+ irc_rootmsg( irc, "End of member list" );
+ }
+ else
+ irc_rootmsg( irc, "Unknown group: %s. Please use \x02group list\x02 to get a list of available groups.", cmd[2] );
+ }
else
{
irc_rootmsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "group", cmd[1] );