X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Fsilcd%2Fpacket_receive.c;h=2f3aa2f7206a5153be05e38422658f1fcd04fba5;hb=d47a87b03b846e2333ef57b2c0d81f1644992964;hp=e93774ae51d931c0766f9961a19986e9844fd9d1;hpb=da1c3bc287b33b27277030d0bd7b9bf0753228be;p=silc.git diff --git a/apps/silcd/packet_receive.c b/apps/silcd/packet_receive.c index e93774ae..2f3aa2f7 100644 --- a/apps/silcd/packet_receive.c +++ b/apps/silcd/packet_receive.c @@ -212,6 +212,8 @@ void silc_server_notify(SilcServer server, /* 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)); @@ -628,6 +630,7 @@ void silc_server_notify(SilcServer server, if (chl2) { chl2->mode = mode; silc_free(channel_id); + silc_hash_table_list_reset(&htl); goto out; } } @@ -638,6 +641,8 @@ void silc_server_notify(SilcServer server, break; } + SILC_LOG_DEBUG(("Changing the channel user mode")); + /* Change the mode */ chl->mode = mode; if (!(mode & SILC_CHANNEL_UMODE_CHANFO)) @@ -646,6 +651,7 @@ void silc_server_notify(SilcServer server, chl2 = chl; } } + silc_hash_table_list_reset(&htl); /* Send the same notify to the channel */ if (!notify_sent) @@ -750,10 +756,10 @@ void silc_server_notify(SilcServer server, 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); @@ -780,9 +786,9 @@ void silc_server_notify(SilcServer server, 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; @@ -790,7 +796,14 @@ void silc_server_notify(SilcServer server, 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); @@ -2486,7 +2499,7 @@ void silc_server_connection_auth_request(SilcServer server, SilcSocketConnection sock, SilcPacketContext *packet) { - SilcServerConfigSectionClientConnection *client = NULL; + SilcServerConfigSectionClient *client = NULL; uint16 conn_type; int ret, port; SilcAuthMethod auth_meth; @@ -2510,11 +2523,11 @@ void silc_server_connection_auth_request(SilcServer server, /* 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)