Added topic to SilcChannelEntry.
[silc.git] / lib / silcclient / command_reply.c
index a737af8d524f1bc1b498fac34504a7488cd421c4..02e6c330f17f6ed1f4f2607d9c7ce7f0308b18ad 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2003 Pekka Riikonen
+  Copyright (C) 1997 - 2004 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -708,6 +708,11 @@ SILC_CLIENT_CMD_REPLY_FUNC(topic)
     goto out;
   }
 
+  if (topic) {
+    silc_free(channel->topic);
+    channel->topic = silc_memdup(topic, strlen(topic));
+  }
+
   /* Notify application */
   COMMAND_REPLY((SILC_ARGS, channel, topic));
 
@@ -1132,6 +1137,11 @@ SILC_CLIENT_CMD_REPLY_FUNC(join)
   if (tmp)
     silc_buffer_set(&chpklist, tmp, len);
 
+  if (topic) {
+    silc_free(channel->topic);
+    channel->topic = silc_memdup(topic, strlen(topic));
+  }
+
   /* Notify application */
   COMMAND_REPLY((SILC_ARGS, channel_name, channel, mode, 0,
                 keyp ? keyp->head : NULL, NULL,