}
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);
}
}
- /* 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;
channel->mode & SILC_CHANNEL_MODE_TOPIC)
goto out;
- /* Set the topic for channel */
+ /* Change the topic */
silc_free(channel->topic);
channel->topic = strdup(tmp);