From d1707838d432e3d95b2a0250bb2ec30fd2ed9ad8 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Mon, 18 Jun 2001 17:04:39 +0000 Subject: [PATCH] updates. --- CHANGES | 35 +++++++++++++++++++ TODO | 32 ++++++----------- .../irssi/src/fe-common/silc/module-formats.c | 1 + .../irssi/src/fe-common/silc/module-formats.h | 1 + apps/irssi/src/silc/core/silc-channels.c | 16 +++++++-- apps/silcd/command.c | 26 ++++++++++---- 6 files changed, 80 insertions(+), 31 deletions(-) diff --git a/CHANGES b/CHANGES index 5da26cd7..baf0e550 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,38 @@ +Mon Jun 18 18:49:07 EEST 2001 Pekka Riikonen + + * Set SILC_MESSAGE_FLAG_NOREPLY when sending the away message. + Added check that if the NOREPLY is set then we will not send + the away message. This avoids infinite loop of away messages + if both clients are away. The affected file is + lib/silcclient/client_prvmsg.c. + + * Fixed client crash if /NICK was given without arguments. + Affected file lib/silcclient/command.c. + + * Server does not send the invite list in INVITE command back + to the client if the list was not altered. Added this notion + to the protocol spec as well. Affected file silcd/command.c. + + Fixed possible crash in INVITE command by checking the + value of silc_server_get_client_route command. + + * Fixed the INVITE notify type handling. The arguments are now + taken in correct order and client does not crash. The affected + file is irssi/src/silc/core/silc-channels.c. + + Removed the "Inviting xxx to channel" message from the + client library away and let the application handle it. + Affected file lib/silcclient/command.c. Added that message + to Irssi SILC client's message formats. + + * Fixed CMODE command crash in client. It now checks the + amount of arguments correctly and does not crash. The affected + file is lib/silcclient/command.c. + + * Do not create new channel automatically in silc_channels_join + but check whether the channel by that name already exists. + Affected file irssi/silc/core/silc-channels.c. + Sun Jun 17 15:26:05 EEST 2001 Pekka Riikonen * Fixed the GETKEY command in the server to check also the diff --git a/TODO b/TODO index bff4996a..94fae2a4 100644 --- a/TODO +++ b/TODO @@ -1,41 +1,31 @@ TODO/bugs in Irssi SILC client ============================== - o If two clients are away and they send private message to each other - it will cause infinite loop of sending away messages to each other. - - o /NICK without arguments crashes the client - - o /CMODE * +a without arguments crashes the client. Check other options - with arguments as well. - - o /INVITE * nick crashes the remote client. - o Add PERL scripting support from Irssi CVS. - o Add KNOCKOUT local command. It should kick an client from channel and - set a ban for it for number of seconds. - - o Add KICKBAN local command. Kicks and bans the specified client. - o Add local commands to list the current server and client public keys that the user has. And a local command to dump the contents of the public key to the screen. Something like LISTKEYS, SHOWKEY... - o Set different kind of settings, like, /set mutual_authentication, - /set key_exchange_timeout, /set conn_auth_timeout etc etc. + o We should get rid of the clientconfig.[ch] in Irssi SILC and move the + cipher, hash, hmac and pkcs configuration to the Irssi SILC's config + file. o Extend the /HELP command to support sub commands or something. So that user can say /help set mutual_authentication they would get help of the mutual_authentication setting. + o Set different kind of settings, like, /set mutual_authentication, + /set key_exchange_timeout, /set conn_auth_timeout etc etc. + + o Add KNOCKOUT local command. It should kick an client from channel and + set a ban for it for number of seconds. + + o Add KICKBAN local command. Kicks and bans the specified client. + o Do some /set show_mail_notification that would show a notification on screen when new email is received. - o We should get rid of the clientconfig.[ch] in Irssi SILC and move the - cipher, hash, hmac and pkcs configuration to the Irssi SILC's config - file. - TODO/bugs In SILC Client Library ================================ diff --git a/apps/irssi/src/fe-common/silc/module-formats.c b/apps/irssi/src/fe-common/silc/module-formats.c index 3222474e..58d1462b 100644 --- a/apps/irssi/src/fe-common/silc/module-formats.c +++ b/apps/irssi/src/fe-common/silc/module-formats.c @@ -42,6 +42,7 @@ FORMAT_REC fecommon_silc_formats[] = { { "no_invite_list", "channel {channel $0} invite list not set", 1, { 0 } }, { "ban_list", "channel {channel $0} ban list: $1", 2, { 0, 0 } }, { "no_ban_list", "channel {channel $0} ban list not set", 1, { 0 } }, + { "inviting", "Inviting {nick $0} to channel {channel $1}", 2, { 0, 0 } }, /* WHOIS, WHOWAS and USERS (alias WHO) messages */ { NULL, "Who Queries", 0 }, diff --git a/apps/irssi/src/fe-common/silc/module-formats.h b/apps/irssi/src/fe-common/silc/module-formats.h index 5b6c08e6..eb36f155 100644 --- a/apps/irssi/src/fe-common/silc/module-formats.h +++ b/apps/irssi/src/fe-common/silc/module-formats.h @@ -39,6 +39,7 @@ enum { SILCTXT_CHANNEL_NO_INVITE_LIST, SILCTXT_CHANNEL_BAN_LIST, SILCTXT_CHANNEL_NO_BAN_LIST, + SILCTXT_CHANNEL_INVITING, SILCTXT_FILL_2, diff --git a/apps/irssi/src/silc/core/silc-channels.c b/apps/irssi/src/silc/core/silc-channels.c index f6dc52f8..2762014a 100644 --- a/apps/irssi/src/silc/core/silc-channels.c +++ b/apps/irssi/src/silc/core/silc-channels.c @@ -76,11 +76,19 @@ static void silc_channels_join(SILC_SERVER_REC *server, const char *channels, int automatic) { char **list, **tmp, *channel; + SILC_CHANNEL_REC *chanrec; list = g_strsplit(channels, ",", -1); for (tmp = list; *tmp != NULL; tmp++) { channel = **tmp == '#' ? g_strdup(*tmp) : g_strconcat("#", *tmp, NULL); + + chanrec = silc_channel_find(server, channel); + if (chanrec) { + g_free(channel); + continue; + } + silc_channel_create(server, channel, FALSE); silc_command_exec(server, "JOIN", channel); g_free(channel); @@ -245,12 +253,14 @@ static void event_invite(SILC_SERVER_REC *server, va_list va) { SilcClientEntry client; SilcChannelEntry channel; + char *channel_name; - client = va_arg(va, SilcClientEntry); channel = va_arg(va, SilcChannelEntry); + channel_name = va_arg(va, char *); + client = va_arg(va, SilcClientEntry); - signal_emit("message invite", 4, server, channel->channel_name, - client->nickname, client->username); + signal_emit("message invite", 4, server, channel ? channel->channel_name : + channel_name, client->nickname, client->username); } /* diff --git a/apps/silcd/command.c b/apps/silcd/command.c index 6bf0d8be..83a22f11 100644 --- a/apps/silcd/command.c +++ b/apps/silcd/command.c @@ -2221,6 +2221,11 @@ SILC_SERVER_CMD_FUNC(invite) /* Get route to the client */ dest_sock = silc_server_get_client_route(server, NULL, 0, dest_id, &idata); + if (!dest_sock) { + silc_server_command_send_status_reply(cmd, SILC_COMMAND_INVITE, + SILC_STATUS_ERR_NO_SUCH_CLIENT_ID); + goto out; + } memset(invite, 0, sizeof(invite)); strncat(invite, dest->nickname, strlen(dest->nickname)); @@ -2307,13 +2312,20 @@ SILC_SERVER_CMD_FUNC(invite) /* Send command reply */ tmp = silc_argument_get_arg_type(cmd->args, 1, &len); - packet = silc_command_reply_payload_encode_va(SILC_COMMAND_INVITE, - SILC_STATUS_OK, ident, 2, - 2, tmp, len, - 3, channel->invite_list, - channel->invite_list ? - strlen(channel->invite_list) : - 0); + + if (add || del) + packet = + silc_command_reply_payload_encode_va(SILC_COMMAND_INVITE, + SILC_STATUS_OK, ident, 2, + 2, tmp, len, + 3, channel->invite_list, + channel->invite_list ? + strlen(channel->invite_list) : 0); + else + packet = + silc_command_reply_payload_encode_va(SILC_COMMAND_INVITE, + SILC_STATUS_OK, ident, 1, + 2, tmp, len); silc_server_packet_send(server, cmd->sock, SILC_PACKET_COMMAND_REPLY, 0, packet->data, packet->len, FALSE); silc_buffer_free(packet); -- 2.24.0