X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fchannel.c;h=a6123457a076eee0e2a10c7960a4682c48ab6375;hb=cac4b71f9ea600608b421127df1f80407182e405;hp=d5d873cae3c7f25ed203eb30fab5411dd94b2c39;hpb=e23115bf4007388be28c0c463f353a4e5e585fff;p=umurmur.git diff --git a/src/channel.c b/src/channel.c index d5d873c..a612345 100644 --- a/src/channel.c +++ b/src/channel.c @@ -315,19 +315,23 @@ int Chan_userJoin_id(int channelid, client_t *client) channelJoinResult_t Chan_userJoin_id_test(int channelid, client_t *client) { + channelJoinResult_t result; channel_t *ch_itr = NULL; do { Chan_iterate(&ch_itr); } while (ch_itr != NULL && ch_itr->id != channelid); if (ch_itr == NULL) { Log_warn("Channel id %d not found - ignoring.", channelid); - return CHJOIN_NOTFOUND; + result.CHJOIN_NOTFOUND = true; } - else if (ch_itr->noenter) - return CHJOIN_NOENTER; - else if (ch_itr->password && !Client_token_match(client, ch_itr->password)) - return CHJOIN_WRONGPW; - else return CHJOIN_OK; + else + result.CHJOIN_NOTFOUND = false; + + result.CHJOIN_NOENTER = ch_itr->noenter; + result.CHJOIN_WRONGPW = ch_itr->password && !Client_token_match(client, ch_itr->password) && !client->isAdmin; + result.CHJOIN_SILENT = ch_itr->silent; + + return result; } #if 0