updates.
authorPekka Riikonen <priikone@silcnet.org>
Sun, 11 Mar 2001 18:46:26 +0000 (18:46 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 11 Mar 2001 18:46:26 +0000 (18:46 +0000)
CHANGES
apps/silcd/command.c
lib/silcclient/command_reply.c

diff --git a/CHANGES b/CHANGES
index 9870d7c467fec317733533de5530af0bdf35126b..5e0f9021baf01d9546736c09eaec49002f2196ac 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+Sun Mar 11 20:25:06 EET 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
+
+       * Fixed a minor bug if WHOIS and IDENTIFY command parsing that
+         just surfaced after chaning the JOIN procedure.
+
 Sun Mar 11 14:59:05 EET 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
 
        * Added silc_client_get_clients_by_list to get client entries
index 2850f39d353758cfb6d50c4e740b6750b2c32082..0b06c10b87f5a0a6d95ebd234b58f84a3ce26172 100644 (file)
@@ -392,9 +392,9 @@ silc_server_command_whois_parse(SilcServerCommandContext cmd,
     *client_id_count = 1;
 
     /* Take all ID's from the command packet */
-    if (argc > 3) {
-      for (k = 1, i = 4; i < argc + 1; i++) {
-       tmp = silc_argument_get_arg_type(cmd->args, i, &len);
+    if (argc > 1) {
+      for (k = 1, i = 1; i < argc; i++) {
+       tmp = silc_argument_get_arg_type(cmd->args, i + 3, &len);
        if (tmp) {
          *client_id = silc_realloc(*client_id, sizeof(**client_id) *
                                    (*client_id_count + 1));
@@ -948,7 +948,7 @@ silc_server_command_identify_send_reply(SilcServerCommandContext cmd,
       
       if (!entry->username) {
        packet = silc_command_reply_payload_encode_va(SILC_COMMAND_IDENTIFY,
-                                                     SILC_STATUS_OK, ident, 2,
+                                                     status, ident, 2,
                                                      2, idp->data, idp->len, 
                                                      3, nh, strlen(nh));
       } else {
@@ -961,7 +961,7 @@ silc_server_command_identify_send_reply(SilcServerCommandContext cmd,
        }
       
        packet = silc_command_reply_payload_encode_va(SILC_COMMAND_IDENTIFY,
-                                                     SILC_STATUS_OK, ident, 3,
+                                                     status, ident, 3,
                                                      2, idp->data, idp->len, 
                                                      3, nh, strlen(nh),
                                                      4, uh, strlen(uh));
index 71f55a9af51c8702190265d2a3ea6c7d2c5fd209..b58d690be8d5b662ae808cf830cf23dc0b7036ff 100644 (file)
@@ -386,7 +386,10 @@ SILC_CLIENT_CMD_REPLY_FUNC(identify)
 
   tmp = silc_argument_get_arg_type(cmd->args, 1, NULL);
   SILC_GET16_MSB(status, tmp);
-  if (status != SILC_STATUS_OK) {
+  if (status != SILC_STATUS_OK && 
+      status != SILC_STATUS_LIST_START &&
+      status != SILC_STATUS_LIST_ITEM &&
+      status != SILC_STATUS_LIST_END) {
     if (status == SILC_STATUS_ERR_NO_SUCH_NICK) {
       /* Take nickname which may be provided */
       tmp = silc_argument_get_arg_type(cmd->args, 3, NULL);
@@ -407,7 +410,10 @@ SILC_CLIENT_CMD_REPLY_FUNC(identify)
   }
 
   /* Display one whois reply */
-  if (status == SILC_STATUS_OK) {
+  if (status == SILC_STATUS_OK ||
+      status == SILC_STATUS_LIST_START ||
+      status == SILC_STATUS_LIST_ITEM ||
+      status == SILC_STATUS_LIST_END) {
     unsigned int len;
     unsigned char *id_data;
     char *nickname;
@@ -458,12 +464,10 @@ SILC_CLIENT_CMD_REPLY_FUNC(identify)
     }
   }
 
-  if (status == SILC_STATUS_LIST_START) {
-
-  }
-
-  if (status == SILC_STATUS_LIST_END) {
-
+  if (status != SILC_STATUS_OK &&
+      status != SILC_STATUS_LIST_END) {
+    silc_client_command_reply_free(cmd);
+    return;
   }
 
   /* Execute any pending command callbacks */