+Thu Sep 20 18:04:12 EEST 2001 Pekka Riikonen <priikone@silcnet.org>
+
+ * When processing JOIN command reply in server check that if
+ the channel exists in our global list we'll move it the local
+ list. Affected file silcd/command_reply.c.
+
+ * Fixed the check whether client is joined on the channel already
+ in JOIN command. Affected file lib/silcclient/command.c.
+
+ * Fixed the JOIN command reply to check whether the channel
+ already exists. Affected file lib/silcclient/command_reply.c.
+
Wed Sep 19 22:58:32 EEST 2001 Pekka Riikonen <priikone@silcnet.org>
* Added silc_ske_status_string to map the SKE error numbers
o Add perhaps /var/run/silcd.pid for PID information for the server.
+ o The backup router support described in the protocol specification
+ should be done at some point.
+
o Add a timeout to handling incmoing JOIN commands. It should be
enforced that JOIN command is executed only once in a second or two
seconds. Now it is possible to accept n incoming JOIN commands
each JOIN command will create and distribute the new channel key
to everybody on the channel.
- o The backup router support described in the protocol specification
- should be done at some point.
+ o Add support for sending the LIST command to primary router on normal
+ server to receive all the created channels. Currently the command
+ returns only the channels the server knows about. The protocol spec
+ does not prohibit of sending the LIST to the router.
o Incomplete IPv6 support:
(created == 0 ? "existing" : "created"), channel_name,
silc_id_render(id, SILC_ID_CHANNEL)));
+ /* If the channel is found from global list we must move it to the
+ local list. */
+ entry = silc_idlist_find_channel_by_name(server->global_list,
+ channel_name, &cache);
+ if (entry)
+ silc_idlist_del_channel(server->global_list, entry);
+
/* Add the channel to our local list. */
entry = silc_idlist_add_channel(server->local_list, strdup(channel_name),
SILC_CHANNEL_MODE_NONE, id,
return FALSE;
/* Free data */
- if (entry->server_name)
- silc_free(entry->server_name);
- if (entry->id)
- silc_free(entry->id);
+ silc_free(entry->server_name);
+ silc_free(entry->id);
memset(entry, 'F', sizeof(*entry));
silc_free(entry);
return FALSE;
/* Free data */
- if (entry->nickname)
- silc_free(entry->nickname);
- if (entry->username)
- silc_free(entry->username);
- if (entry->userinfo)
- silc_free(entry->userinfo);
- if (entry->id)
- silc_free(entry->id);
+ silc_free(entry->nickname);
+ silc_free(entry->username);
+ silc_free(entry->userinfo);
+ silc_free(entry->id);
memset(entry, 'F', sizeof(*entry));
silc_free(entry);
return FALSE;
/* Free data */
- if (entry->channel_name)
- silc_free(entry->channel_name);
- if (entry->id)
- silc_free(entry->id);
- if (entry->topic)
- silc_free(entry->topic);
+ silc_free(entry->channel_name);
+ silc_free(entry->id);
+ silc_free(entry->topic);
if (entry->channel_key)
silc_cipher_free(entry->channel_key);
if (entry->key) {
memset(entry->key, 0, entry->key_len / 8);
silc_free(entry->key);
}
- if (entry->cipher)
- silc_free(entry->cipher);
- if (entry->hmac_name)
- silc_free(entry->hmac_name);
- if (entry->rekey)
- silc_free(entry->rekey);
+ silc_free(entry->cipher);
+ silc_free(entry->hmac_name);
+ silc_free(entry->rekey);
/* Free all client entrys from the users list. The silc_hash_table_free
will free all the entries so they are not freed at the foreach
/* See if we have joined to the requested channel already */
if (silc_idcache_find_by_name_one(conn->channel_cache, cmd->argv[1],
- &id_cache))
- goto out;
+ &id_cache)) {
+ SilcChannelEntry channel = (SilcChannelEntry)id_cache->context;
+ if (channel->on_channel)
+ goto out;
+ }
idp = silc_id_payload_encode(conn->local_id, SILC_ID_CLIENT);
}
channel = (SilcChannelEntry)id_cache->context;
+ channel->on_channel = FALSE;
/* Send LEAVE command to the server */
idp = silc_id_payload_encode(id_cache->id, SILC_ID_CHANNEL);
/* Get topic */
topic = silc_argument_get_arg_type(cmd->args, 10, NULL);
+ /* If we have the channel entry, remove it and create a new one */
+ channel = silc_client_get_channel(cmd->client, conn, channel_name);
+ if (channel)
+ silc_client_del_channel(cmd->client, conn, channel);
+
/* Save received Channel ID. This actually creates the channel */
channel = silc_client_new_channel_id(cmd->client, cmd->sock, channel_name,
mode, idp);
char *channel_name;
SilcChannelID *id;
uint32 mode;
- int on_channel;
+ bool on_channel;
/* Joined clients */
SilcList clients;