/* The channel is global now */
channel->global_users = TRUE;
+ SILC_LOG_DEBUG(("Joining to channel %s", channel->channel_name));
+
/* JOIN the global client to the channel (local clients (if router
created the channel) is joined in the pending JOIN command). */
chl = silc_calloc(1, sizeof(*chl));
if (chl2) {
chl2->mode = mode;
silc_free(channel_id);
+ silc_hash_table_list_reset(&htl);
goto out;
}
}
break;
}
+ SILC_LOG_DEBUG(("Changing the channel user mode"));
+
/* Change the mode */
chl->mode = mode;
if (!(mode & SILC_CHANNEL_UMODE_CHANFO))
chl2 = chl;
}
}
+ silc_hash_table_list_reset(&htl);
/* Send the same notify to the channel */
if (!notify_sent)
goto out;
/* Get the channel entry */
- channel = silc_idlist_find_channel_by_id(server->global_list,
+ channel = silc_idlist_find_channel_by_id(server->local_list,
channel_id, NULL);
if (!channel) {
- channel = silc_idlist_find_channel_by_id(server->local_list,
+ channel = silc_idlist_find_channel_by_id(server->global_list,
channel_id, NULL);
if (!channel) {
silc_free(channel_id);
silc_id_render(channel_id2, SILC_ID_CHANNEL)));
/* Replace the Channel ID */
- if (!silc_idlist_replace_channel_id(server->global_list, channel_id,
+ if (!silc_idlist_replace_channel_id(server->local_list, channel_id,
channel_id2))
- if (!silc_idlist_replace_channel_id(server->local_list, channel_id,
+ if (!silc_idlist_replace_channel_id(server->global_list, channel_id,
channel_id2)) {
silc_free(channel_id2);
channel_id2 = NULL;
if (channel_id2) {
SilcBuffer users = NULL, users_modes = NULL;
-
+
+ /* Re-announce this channel which ID was changed. */
+ silc_server_send_new_channel(server, sock, FALSE, channel->channel_name,
+ channel->id,
+ silc_id_get_len(channel->id,
+ SILC_ID_CHANNEL),
+ channel->mode);
+
/* Re-announce our clients on the channel as the ID has changed now */
silc_server_announce_get_channel_users(server, channel, &users,
&users_modes);
if (!server_entry) {
server_entry = silc_idlist_find_server_by_id(server->local_list,
server_id, TRUE, NULL);
- global = TRUE;
+ local = TRUE;
if (!server_entry) {
/* If we are normal server then we might not have the server. Check
whether router was kind enough to send the list of all clients
if (tmp && channel->ban_list) {
char *start, *end, *n;
- if (!strcmp(channel->ban_list, tmp)) {
+ if (!strncmp(channel->ban_list, tmp, strlen(channel->ban_list) - 1)) {
silc_free(channel->ban_list);
channel->ban_list = NULL;
} else {
router = silc_idlist_find_server_by_id(server->local_list,
sender_id, TRUE, NULL);
silc_free(sender_id);
- if (!router)
- goto out;
router_sock = sock;
id_list = server->global_list;
}
+ if (!router)
+ goto out;
+
switch(id_type) {
case SILC_ID_CLIENT:
{
SilcSocketConnection sock,
SilcPacketContext *packet)
{
- SilcServerConfigSectionClientConnection *client = NULL;
+ SilcServerConfigSectionClient *client = NULL;
uint16 conn_type;
int ret, port;
SilcAuthMethod auth_meth;
/* Get the authentication method for the client */
auth_meth = SILC_AUTH_NONE;
port = server->sockets[server->sock]->port; /* Listenning port */
- client = silc_server_config_find_client_conn(server->config,
+ client = silc_server_config_find_client(server->config,
sock->ip,
port);
if (!client)
- client = silc_server_config_find_client_conn(server->config,
+ client = silc_server_config_find_client(server->config,
sock->hostname,
port);
if (client)