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