X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fchannel.c;h=77ee4157dfe3fba941e29a76a6561c2d5b8e55b8;hb=b91d06fed25bc7f602b2119f829ba962890a6b4f;hp=1fab5a4a793cdde82849bb36373798d03697c40e;hpb=0f60078dfd1f7a770311c3dffa011788e5b7dcc2;p=umurmur.git diff --git a/src/channel.c b/src/channel.c index 1fab5a4..77ee415 100644 --- a/src/channel.c +++ b/src/channel.c @@ -29,6 +29,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include +#include +#include #include "log.h" #include "list.h" #include "client.h" @@ -274,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);