aboutsummaryrefslogtreecommitdiffstats
path: root/irc_channel.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-08-14 14:44:35 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-08-14 14:44:35 +0100
commit07874bef9e9c4e6ace44e4d0605ce1aec89cad74 (patch)
treec2a0a0bc30f2fcec7af83b2fb3fe59bbec393116 /irc_channel.c
parent584867592546f43f857645e02169d135f0df25e8 (diff)
parent136c2bb632715ab83710c93c7b339c5cca7d2679 (diff)
Merge mainline stuff.
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;