From c2fefb8750238e269ae5def8aba701f6bb5805dc Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sun, 3 Apr 2005 20:15:52 +0000 Subject: [PATCH] Do not change first joining user as founder if founder mode is set. Do not send CUMODE_CHANGE notify back to sender. --- apps/silcd/packet_receive.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/apps/silcd/packet_receive.c b/apps/silcd/packet_receive.c index 33657ebc..35d9ccbb 100644 --- a/apps/silcd/packet_receive.c +++ b/apps/silcd/packet_receive.c @@ -227,13 +227,16 @@ void silc_server_notify(SilcServer server, if (server->server_type != SILC_ROUTER || sock->type == SILC_SOCKET_TYPE_ROUTER) { - /* If this is the first one on the channel then it is the founder of - the channel. This is done on normal server and on router if this - notify is coming from router */ - if (!silc_hash_table_count(channel->user_list)) { - SILC_LOG_DEBUG(("Client %s is founder on channel", - silc_id_render(chl->client->id, SILC_ID_CLIENT))); - chl->mode = (SILC_CHANNEL_UMODE_CHANOP | SILC_CHANNEL_UMODE_CHANFO); + /* If founder auth is set, first client is not automatically founder. */ + if (!(channel->mode & SILC_CHANNEL_MODE_FOUNDER_AUTH)) { + /* If this is the first one on the channel then it is the founder of + the channel. This is done on normal server and on router if this + notify is coming from router */ + if (!silc_hash_table_count(channel->user_list)) { + SILC_LOG_DEBUG(("Client %s is founder on channel", + silc_id_render(chl->client->id, SILC_ID_CLIENT))); + chl->mode = (SILC_CHANNEL_UMODE_CHANOP | SILC_CHANNEL_UMODE_CHANFO); + } } } @@ -778,6 +781,7 @@ void silc_server_notify(SilcServer server, if (channel->founder_key) silc_pkcs_public_key_free(channel->founder_key); channel->founder_key = NULL; + SILC_LOG_DEBUG(("Founder public key received")); if (!silc_pkcs_public_key_payload_decode(tmp, tmp_len, &channel->founder_key)) { SILC_LOG_DEBUG(("Enforcing sender to change channel mode")); @@ -1070,7 +1074,7 @@ void silc_server_notify(SilcServer server, /* Send the same notify to the channel */ if (!notify_sent) - silc_server_packet_send_to_channel(server, NULL, channel, + silc_server_packet_send_to_channel(server, sock, channel, packet->type, FALSE, TRUE, packet->buffer->data, packet->buffer->len, FALSE); -- 2.24.0