From eb37735451207895e7e1b5b3dcc0f9cbe178ad38 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 9 May 2010 00:54:37 +0100 Subject: This is how you now start groupchats: /join #channel, /invite people. --- irc_im.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'irc_im.c') diff --git a/irc_im.c b/irc_im.c index c5384fed..42186bc9 100644 --- a/irc_im.c +++ b/irc_im.c @@ -258,9 +258,20 @@ static gboolean bee_irc_chat_new( bee_t *bee, struct groupchat *c ) irc_t *irc = bee->ui_data; irc_channel_t *ic; char *topic; + GSList *l; int i; - for( i = 0; i <= 999; i ++ ) + /* Try to find a channel that expects to receive a groupchat. + This flag is set by groupchat_stub_invite(). */ + for( l = irc->channels; l; l = l->next ) + { + ic = l->data; + if( ic->flags & IRC_CHANNEL_CHAT_PICKME ) + break; + } + + /* If we found none, just generate some stupid name. */ + if( l == NULL ) for( i = 0; i <= 999; i ++ ) { char name[16]; sprintf( name, "&chat_%03d", i ); -- cgit v1.2.3