X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Fsilcd%2Fcommand.c;h=086836c5645b65fc17cd9b6e1a8574d3d001f671;hb=994158889dde7e9d13994b8648c56b829fda45bb;hp=2790042ee907814db0965777dfd8ac5a350a8c06;hpb=43ac60aa4ee4d93aec9f21a771ddd7a860d6ebe7;p=silc.git diff --git a/apps/silcd/command.c b/apps/silcd/command.c index 2790042e..086836c5 100644 --- a/apps/silcd/command.c +++ b/apps/silcd/command.c @@ -3583,26 +3583,27 @@ SILC_SERVER_CMD_FUNC(join) if (!channel || (channel->disabled && server->server_type != SILC_ROUTER)) { - /* Channel not found */ + /* Channel not found or not valid */ /* If we are standalone server we don't have a router, we just create - the channel by ourselves. */ + the channel by ourselves (unless it existed). */ if (server->standalone) { - channel = silc_server_create_new_channel(server, server->id, cipher, - hmac, channel_name, TRUE); if (!channel) { - silc_server_command_send_status_reply( - cmd, SILC_COMMAND_JOIN, - SILC_STATUS_ERR_UNKNOWN_ALGORITHM, - 0); - silc_free(client_id); - goto out; - } - - umode = (SILC_CHANNEL_UMODE_CHANOP | SILC_CHANNEL_UMODE_CHANFO); - created = TRUE; - create_key = FALSE; + channel = silc_server_create_new_channel(server, server->id, cipher, + hmac, channel_name, TRUE); + if (!channel) { + silc_server_command_send_status_reply( + cmd, SILC_COMMAND_JOIN, + SILC_STATUS_ERR_UNKNOWN_ALGORITHM, + 0); + silc_free(client_id); + goto out; + } + umode = (SILC_CHANNEL_UMODE_CHANOP | SILC_CHANNEL_UMODE_CHANFO); + created = TRUE; + create_key = FALSE; + } } else { /* The channel does not exist on our server. If we are normal server