Do not send invite list back unless it's modified.
authorPekka Riikonen <priikone@silcnet.org>
Wed, 27 Nov 2002 15:01:51 +0000 (15:01 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 27 Nov 2002 15:01:51 +0000 (15:01 +0000)
CHANGES
apps/silcd/command.c

diff --git a/CHANGES b/CHANGES
index ae92f9e706c6fbcb7e568292f19cf28c6eb3cc1c..46f022efa1fe73ee0bc312464646a19f308e4d3a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+Wed Nov 27 16:01:11 CET 2002  Pekka Riikonen <priikone@silcnet.org>
+
+       * Do not send invite list back unless asked (when sending
+         no arguments) or when list was modified.  Affected file
+         silcd/command.c.
+
 Mon Nov 25 18:21:43 EET 2002  Pekka Riikonen <priikone@silcnet.org>
 
        * The silc_argument_get_[first/next] now return the argument
index e5f6d0a40410a72789ba8abd4374d567ddbf0055..b372dc80840b33b99b773d983bc038d16042daec 100644 (file)
@@ -1237,13 +1237,23 @@ SILC_SERVER_CMD_FUNC(invite)
                         silc_argument_get_arg_type(cmd->args, 3, NULL),
                         list);
 
+  /* Send invite list back only if the list was modified, or now arguments
+     was given. */
+  type = 0;
+  argc = silc_argument_get_arg_num(cmd->args);
+  if (argc == 1)
+    type = 1;
+  if (silc_argument_get_arg_type(cmd->args, 3, &len))
+    type = 1;
+
   /* 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, 0, ident, 2,
                                                2, tmp, len,
-                                               3, list ? list->data : NULL,
-                                               list ? list->len : 0);
+                                               3, type && list ? 
+                                               list->data : NULL,
+                                               type && list ? list->len : 0);
   silc_server_packet_send(server, cmd->sock, SILC_PACKET_COMMAND_REPLY, 0, 
                          packet->data, packet->len, FALSE);
   silc_buffer_free(packet);