diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2007-06-14 00:32:56 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2007-06-14 00:32:56 +0100 | 
| commit | bdda9e9ae418e19bd8fa57a019267f567d537018 (patch) | |
| tree | b67ceaa8e3b7e655d5a2b10810829e5c8b2b1aa6 /irc.c | |
| parent | 998b1035a6c8349b3661861eeb5d9d1f4082ba0a (diff) | |
Fixed irc_chat_by_channel() to not break if using multiple IM accounts
where some of them are down.
Diffstat (limited to 'irc.c')
| -rw-r--r-- | irc.c | 14 | 
1 files changed, 11 insertions, 3 deletions
| @@ -1223,9 +1223,17 @@ struct groupchat *irc_chat_by_channel( irc_t *irc, char *channel )  	/* This finds the connection which has a conversation which belongs to this channel */  	for( a = irc->accounts; a; a = a->next )  	{ -		for( c = a->ic->groupchats; c && g_strcasecmp( c->channel, channel ) != 0; c = c->next ); -		if( c ) -			return c; +		if( a->ic == NULL ) +			continue; +		 +		c = a->ic->groupchats; +		while( c ) +		{ +			if( c->channel && g_strcasecmp( c->channel, channel ) == 0 ) +				return c; +			 +			c = c->next; +		}  	}  	return NULL; | 
