aboutsummaryrefslogtreecommitdiffstats
path: root/irc_im.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-05-09 00:54:37 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-05-09 00:54:37 +0100
commiteb37735451207895e7e1b5b3dcc0f9cbe178ad38 (patch)
tree0e64d60cc7fdefc9d6fd8f6a4d7d789612a62d89 /irc_im.c
parent66b9e36aa9dfd123c66194d645a3c60cc3dc49bc (diff)
This is how you now start groupchats: /join #channel, /invite people.
Diffstat (limited to 'irc_im.c')
-rw-r--r--irc_im.c13
1 files changed, 12 insertions, 1 deletions
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 );