diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-08-25 01:18:27 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-08-25 01:18:27 +0100 |
commit | a72af0dc9b76451f5aa57ac9443267a97c794f95 (patch) | |
tree | 0120458f36dc0ad4ec93582673d7f05073d6f90f /irc_commands.c | |
parent | bd599b9aeabee36ac6fdb379ca09aec27cce13a4 (diff) |
Fix /WHO on single nicks.
Diffstat (limited to 'irc_commands.c')
-rw-r--r-- | irc_commands.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/irc_commands.c b/irc_commands.c index 4b1bc741..7874f519 100644 --- a/irc_commands.c +++ b/irc_commands.c @@ -301,11 +301,19 @@ static void irc_cmd_who( irc_t *irc, char **cmd ) { char *channel = cmd[1]; irc_channel_t *ic; + irc_user_t *iu; if( !channel || *channel == '0' || *channel == '*' || !*channel ) irc_send_who( irc, irc->users, "**" ); else if( ( ic = irc_channel_by_name( irc, channel ) ) ) irc_send_who( irc, ic->users, channel ); + else if( ( iu = irc_user_by_name( irc, channel ) ) ) + { + /* Tiny hack! */ + GSList *l = g_slist_append( NULL, iu ); + irc_send_who( irc, l, channel ); + g_slist_free( l ); + } else irc_send_num( irc, 403, "%s :No such channel", channel ); } |