aboutsummaryrefslogtreecommitdiffstats
path: root/irc_im.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-11-20 20:25:44 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2010-11-20 20:25:44 +0000
commitbb151f7aad467bf29c6e5ca552088f7f0b8ec876 (patch)
treeae64dfee90c7beec134cb6a1f2832eb0ec095996 /irc_im.c
parentd68365c5a799556a9375ac7e08d78d7dc80010ce (diff)
Added irc_channel_with_user() function to find a suitable channel to show
a user's message in, instead of just &bitlbee by default.
Diffstat (limited to 'irc_im.c')
-rw-r--r--irc_im.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/irc_im.c b/irc_im.c
index 73ad697a..4e847d35 100644
--- a/irc_im.c
+++ b/irc_im.c
@@ -54,6 +54,11 @@ static gboolean bee_irc_user_new( bee_t *bee, bee_user_t *bu )
bu->ui_data = iu = irc_user_new( irc, nick );
iu->bu = bu;
+ if( set_getbool( &irc->b->set, "private" ) )
+ iu->last_channel = NULL;
+ else
+ iu->last_channel = irc_channel_with_user( irc, iu );
+
if( ( s = strchr( bu->handle, '@' ) ) )
{
iu->host = g_strdup( s + 1 );
@@ -209,8 +214,8 @@ static gboolean bee_irc_user_msg( bee_t *bee, bee_user_t *bu, const char *msg_,
{
if( iu->last_channel->flags & IRC_CHANNEL_JOINED )
ic = iu->last_channel;
- else if( irc->default_channel->flags & IRC_CHANNEL_JOINED )
- ic = irc->default_channel;
+ else
+ ic = irc_channel_with_user( irc, iu );
}
if( ic )