diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-08-14 11:55:20 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-08-14 11:55:20 +0100 |
commit | ac2717b6a60900d31236b7696f150d0120bda3da (patch) | |
tree | aea6f42167d75c9c41116491cbdb09cc9fbec735 /root_commands.c | |
parent | 4ffd757724a657d2dc5c536473523a86f2331d9e (diff) |
blist should only show contacts that are (or would be if they were online)
in the current channel.
Diffstat (limited to 'root_commands.c')
-rw-r--r-- | root_commands.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/root_commands.c b/root_commands.c index 6bd953fc..2cd1a617 100644 --- a/root_commands.c +++ b/root_commands.c @@ -1007,12 +1007,16 @@ static void cmd_blist( irc_t *irc, char **cmd ) irc_usermsg( irc, format, "Nick", "Handle/Account", "Status" ); + if( strcmp( set_getstr( &irc->root->last_channel->set, "type" ), "control" ) != 0 ) + irc->root->last_channel = NULL; + for( l = irc->users; l; l = l->next ) { irc_user_t *iu = l->data; bee_user_t *bu = iu->bu; - if( !bu || ( bu->flags & ( BEE_USER_ONLINE | BEE_USER_AWAY ) ) != BEE_USER_ONLINE ) + if( !bu || ( irc->root->last_channel && !irc_channel_wants_user( irc->root->last_channel, iu ) ) || + ( bu->flags & ( BEE_USER_ONLINE | BEE_USER_AWAY ) ) != BEE_USER_ONLINE ) continue; if( online == 1 ) @@ -1034,7 +1038,8 @@ static void cmd_blist( irc_t *irc, char **cmd ) irc_user_t *iu = l->data; bee_user_t *bu = iu->bu; - if( !bu || !( bu->flags & BEE_USER_ONLINE ) || !( bu->flags & BEE_USER_AWAY ) ) + if( !bu || ( irc->root->last_channel && !irc_channel_wants_user( irc->root->last_channel, iu ) ) || + !( bu->flags & BEE_USER_ONLINE ) || !( bu->flags & BEE_USER_AWAY ) ) continue; if( away == 1 ) @@ -1050,7 +1055,8 @@ static void cmd_blist( irc_t *irc, char **cmd ) irc_user_t *iu = l->data; bee_user_t *bu = iu->bu; - if( !bu || bu->flags & BEE_USER_ONLINE ) + if( !bu || ( irc->root->last_channel && !irc_channel_wants_user( irc->root->last_channel, iu ) ) || + bu->flags & BEE_USER_ONLINE ) continue; if( offline == 1 ) |