Added topic to SilcChannelEntry.
authorPekka Riikonen <priikone@silcnet.org>
Tue, 17 Feb 2004 16:02:32 +0000 (16:02 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 17 Feb 2004 16:02:32 +0000 (16:02 +0000)
CHANGES
lib/silcclient/client_notify.c
lib/silcclient/command_reply.c
lib/silcclient/idlist.c
lib/silcclient/silcclient.h

diff --git a/CHANGES b/CHANGES
index aa7547ae2bcbb52dc9010ba8eaa22bb96ddc1b94..a9451e2bdbc73915428dedb772ca5eada8f398ea 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,11 @@
+Tue Feb 17 19:34:30 EET 2004  Pekka Riikonen <priikone@silcnet.org>
+
+       * Fixed silc_client_send_private_message to return TRUE correctly.
+         Affected file lib/silcclient/client_prvmsg.c.
+
+       * Added topic to the SilcChannelEntry.  Affected files are
+         lib/silcclient/silcclient.h, command_reply.c, client_notify.c.
+
 Fri Feb 13 14:19:14 CET 2004  Jochen Eisinger <jochen@penguin-breeder.org>
 
        * Use conn->cmd_ident for all silc_client_command_call()s.  Affected
@@ -7,9 +15,9 @@ Fri Feb 13 13:53:45 CET 2004  Jochen Eisinger <jochen@penguin-breeder.org>
 
        * Convert all commands to UTF-8 before passing them to the
          client library.  Still need to convert replies from UTF-8 to
-         the locale encoding.  Affected file 
+         the locale encoding.  Affected file
          irssi/src/silc/core/silc-cmdqueue.c
-         
+
 Fri Feb 13 13:13:07 CET 2004  Jochen Eisinger <jochen@penguin-breeder.org>
 
        * redirect all silc_client_command_calls through a queueing framework.
index ebda8bdc47444e14963c90d44ee01e45a6bb72a9..0dbde2f9062cd399a29315af5bc21ca878ee91b3 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
@@ -556,6 +556,11 @@ void silc_client_notify_by_server(SilcClient client,
       goto out;
     }
 
+    if (tmp) {
+      silc_free(channel->topic);
+      channel->topic = silc_memdup(tmp, strlen(tmp));
+    }
+
     /* Notify application. The channel entry is sent last as this notify
        is for channel but application don't know it from the arguments
        sent by server. */
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,
index 7969263e1ca99e8064f93fb52b62313c1ea85702..00a24a2e5c443fb3871fa3972227876a0a33832c 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2001 - 2003 Pekka Riikonen
+  Copyright (C) 2001 - 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
@@ -963,6 +963,7 @@ bool silc_client_del_channel(SilcClient client, SilcClientConnection conn,
   silc_hash_table_free(channel->user_list);
 
   silc_free(channel->channel_name);
+  silc_free(channel->topic);
   silc_free(channel->id);
   silc_free(channel->key);
   if (channel->channel_key)
index 076cbdc664ab91515a726efe317ae4538a614485..94f67983f479e693b209b6323b67ed62bea6b6c5 100644 (file)
@@ -255,6 +255,7 @@ struct SilcChannelEntryStruct {
   char *channel_name;                       /* Channel name */
   SilcChannelID *id;                        /* Channel ID */
   SilcUInt32 mode;                          /* Channel mode, ChannelModes. */
+  char *topic;                              /* Current topic, may be NULL */
 
   /* All clients that has joined this channel.  The key to the table is the
      SilcClientEntry and the context is SilcChannelUser context. */