Change topic only if it really changed.
authorPekka Riikonen <priikone@silcnet.org>
Tue, 26 Mar 2002 18:33:53 +0000 (18:33 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 26 Mar 2002 18:33:53 +0000 (18:33 +0000)
CHANGES
apps/silcd/packet_receive.c

diff --git a/CHANGES b/CHANGES
index 63c7053e5dd8b903b0bde0a44ae9866483e2c05f..be5c28e67c74a62b7e136f74b7021d384dc5a6e6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+Tue Mar 26 19:33:03 CET 2002  Pekka Riikonen <priikone@silcnet.org>
+
+       * 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 <priikone@silcnet.org>
 
        * Added cross-reference support to the SILC Documentation
index 87f8b70f082d61ad3b50a025a15e510c5b72c108..111f3b019ceaa1a0c536c41ec3070476a5cf485d 100644 (file)
@@ -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);