updates.
authorPekka Riikonen <priikone@silcnet.org>
Mon, 18 Jun 2001 17:04:39 +0000 (17:04 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Mon, 18 Jun 2001 17:04:39 +0000 (17:04 +0000)
CHANGES
TODO
apps/irssi/src/fe-common/silc/module-formats.c
apps/irssi/src/fe-common/silc/module-formats.h
apps/irssi/src/silc/core/silc-channels.c
apps/silcd/command.c

diff --git a/CHANGES b/CHANGES
index 5da26cd76a99f9d65f6f4af60c230ff75489fc7d..baf0e550251adc7995070c315c73e4296e8b938a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,38 @@
+Mon Jun 18 18:49:07 EEST 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
+
+       * 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 <priikone@poseidon.pspt.fi>
 
        * Fixed the GETKEY command in the server to check also the
diff --git a/TODO b/TODO
index bff4996a79ee90dd0abf9e3e63bc2abc9fae1fd1..94fae2a478a6e8c4a970124105bd24522bc329e4 100644 (file)
--- 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
 ================================
index 3222474e7263ed5b40182cfc6049e8e690768fed..58d1462b0bc6e6f58527be93e4c3316d091b37bf 100644 (file)
@@ -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 },
index 5b6c08e6314e4386711260833be970db056a105a..eb36f1551f918e95011b0f7f1ba87a18add03cf9 100644 (file)
@@ -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,
 
index f6dc52f89351cf4795110edcd92473357ebbce11..2762014ad7edfe60a93eccccaaa0c62880d10764 100644 (file)
@@ -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);
 }
 
 /*
index 6bf0d8be079b05d05596e2edb9d7926a445b9f2a..83a22f11a165fecf0faab1d44139b54439b9540f 100644 (file)
@@ -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);