Merged from silc_1_0_branch.
[silc.git] / lib / silcclient / command_reply.c
index d615c14204e31f67138afae054961ae7c7e55b58..0ae2890bf8c233eee94188c01c2014e99e75a909 100644 (file)
@@ -1744,6 +1744,7 @@ SILC_CLIENT_CMD_REPLY_FUNC(users)
 {
   SilcClientCommandReplyContext cmd = (SilcClientCommandReplyContext)context;
   SilcClientConnection conn = (SilcClientConnection)cmd->sock->user_data;
+  SilcClientCommandReplyContext r = (SilcClientCommandReplyContext)context2;
 
   SILC_LOG_DEBUG(("Start"));
 
@@ -1754,6 +1755,13 @@ SILC_CLIENT_CMD_REPLY_FUNC(users)
     goto out;
   }
 
+  if (r && !silc_command_get_status(r->payload, NULL, &cmd->error)) {
+    SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+       "%s", silc_get_status_message(cmd->error));
+    COMMAND_REPLY_ERROR;
+    goto out;
+  }
+
   if (silc_client_command_reply_users_save(cmd, cmd->status, TRUE,
                                           silc_client_command_reply_users_cb,
                                           silc_client_command_reply_users))
@@ -1818,6 +1826,14 @@ SILC_CLIENT_CMD_REPLY_FUNC(getkey)
       goto out;
     }
 
+    /* Save fingerprint */
+    if (!client_entry->fingerprint) {
+      client_entry->fingerprint = silc_calloc(20, sizeof(unsigned char));
+      client_entry->fingerprint_len = 20;
+      silc_hash_make(cmd->client->sha1hash, tmp + 4, len - 4,
+                    client_entry->fingerprint);
+    }
+
     /* Notify application */
     COMMAND_REPLY((SILC_ARGS, id_type, client_entry, public_key));
   } else if (id_type == SILC_ID_SERVER) {