From fedd44bf38380915853e43f32e122e4183079edd Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Tue, 17 Feb 2004 16:02:32 +0000 Subject: [PATCH] Added topic to SilcChannelEntry. --- CHANGES | 12 ++++++++++-- lib/silcclient/client_notify.c | 7 ++++++- lib/silcclient/command_reply.c | 12 +++++++++++- lib/silcclient/idlist.c | 3 ++- lib/silcclient/silcclient.h | 1 + 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index aa7547ae..a9451e2b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,11 @@ +Tue Feb 17 19:34:30 EET 2004 Pekka Riikonen + + * 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 * 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 * 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 * redirect all silc_client_command_calls through a queueing framework. diff --git a/lib/silcclient/client_notify.c b/lib/silcclient/client_notify.c index ebda8bdc..0dbde2f9 100644 --- a/lib/silcclient/client_notify.c +++ b/lib/silcclient/client_notify.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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. */ diff --git a/lib/silcclient/command_reply.c b/lib/silcclient/command_reply.c index a737af8d..02e6c330 100644 --- a/lib/silcclient/command_reply.c +++ b/lib/silcclient/command_reply.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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, diff --git a/lib/silcclient/idlist.c b/lib/silcclient/idlist.c index 7969263e..00a24a2e 100644 --- a/lib/silcclient/idlist.c +++ b/lib/silcclient/idlist.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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) diff --git a/lib/silcclient/silcclient.h b/lib/silcclient/silcclient.h index 076cbdc6..94f67983 100644 --- a/lib/silcclient/silcclient.h +++ b/lib/silcclient/silcclient.h @@ -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. */ -- 2.43.0