aboutsummaryrefslogtreecommitdiffstats
path: root/irc_channel.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-08-14 11:55:20 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-08-14 11:55:20 +0100
commitac2717b6a60900d31236b7696f150d0120bda3da (patch)
treeaea6f42167d75c9c41116491cbdb09cc9fbec735 /irc_channel.c
parent4ffd757724a657d2dc5c536473523a86f2331d9e (diff)
blist should only show contacts that are (or would be if they were online)
in the current channel.
Diffstat (limited to 'irc_channel.c')
-rw-r--r--irc_channel.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/irc_channel.c b/irc_channel.c
index 0498cffa..118fef74 100644
--- a/irc_channel.c
+++ b/irc_channel.c
@@ -725,6 +725,31 @@ fail:
return SET_INVALID;
}
+/* Figure out if a channel is supposed to have the user, assuming s/he is
+ online or otherwise also selected by the show_users setting. Only works
+ for control channels, but does *not* check if this channel is of that
+ type. Beware! */
+gboolean irc_channel_wants_user( irc_channel_t *ic, irc_user_t *iu )
+{
+ struct irc_control_channel *icc = ic->data;
+
+ if( iu->bu == NULL )
+ return FALSE;
+
+ switch( icc->type )
+ {
+ case IRC_CC_TYPE_GROUP:
+ return iu->bu->group == icc->group;
+ case IRC_CC_TYPE_ACCOUNT:
+ return iu->bu->ic->acc == icc->account;
+ case IRC_CC_TYPE_PROTOCOL:
+ return iu->bu->ic->acc->prpl == icc->protocol;
+ case IRC_CC_TYPE_DEFAULT:
+ default:
+ return TRUE;
+ }
+}
+
static gboolean control_channel_free( irc_channel_t *ic )
{
struct irc_control_channel *icc = ic->data;