From: fatbob313 Date: Sat, 27 Feb 2010 21:02:51 +0000 (+0000) Subject: Fix crash when entering a temporary channel when already in the channel. X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;h=44404c56e7d21f742aa42cdd14dbe4598faa85b4;p=umurmur.git Fix crash when entering a temporary channel when already in the channel. --- diff --git a/src/channel.c b/src/channel.c index 3524a96..77ee415 100644 --- a/src/channel.c +++ b/src/channel.c @@ -276,9 +276,12 @@ int Chan_userLeave(client_t *client) int Chan_userJoin(channel_t *ch, client_t *client) { int leaving_id; + + /* Do nothing if user already is in this channel */ + if ((channel_t *)client->channel == ch) + return 0; Log_debug("Add user %s to channel %s", client->username, ch->name); - /* Only allowed in one channel at a time */ leaving_id = Chan_userLeave(client); list_add_tail(&client->chan_node, &ch->clients);