From b9517d852cd7c66a19da81ba80e73476560b729c Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Tue, 26 Mar 2002 18:33:53 +0000 Subject: [PATCH] Change topic only if it really changed. --- CHANGES | 5 +++++ apps/silcd/packet_receive.c | 19 +++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 63c7053e..be5c28e6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +Tue Mar 26 19:33:03 CET 2002 Pekka Riikonen + + * Don't change the topic if olod topic is same as new one. + Affected file is silcd/packet_receive.c. + Mon Mar 25 21:11:35 EET 2002 Pekka Riikonen * Added cross-reference support to the SILC Documentation diff --git a/apps/silcd/packet_receive.c b/apps/silcd/packet_receive.c index 87f8b70f..111f3b01 100644 --- a/apps/silcd/packet_receive.c +++ b/apps/silcd/packet_receive.c @@ -371,6 +371,16 @@ void silc_server_notify(SilcServer server, } silc_free(client_id); + /* Get the topic */ + tmp = silc_argument_get_arg_type(args, 2, &tmp_len); + if (!tmp) { + silc_free(channel_id); + goto out; + } + + if (channel->topic && !strcmp(channel->topic, tmp)) + goto out; + if (!channel_id) { channel_id = silc_id_str2id(packet->dst_id, packet->dst_id_len, packet->dst_id_type); @@ -390,13 +400,6 @@ void silc_server_notify(SilcServer server, } } - /* Get the topic */ - tmp = silc_argument_get_arg_type(args, 2, &tmp_len); - if (!tmp) { - silc_free(channel_id); - goto out; - } - /* Get user's channel entry and check that topic set is allowed. */ if (!silc_server_client_on_channel(client, channel, &chl)) goto out; @@ -404,7 +407,7 @@ void silc_server_notify(SilcServer server, channel->mode & SILC_CHANNEL_MODE_TOPIC) goto out; - /* Set the topic for channel */ + /* Change the topic */ silc_free(channel->topic); channel->topic = strdup(tmp); -- 2.24.0