JOIN command reply to return founder key and channel public keys
authorPekka Riikonen <priikone@silcnet.org>
Fri, 8 Aug 2003 14:32:14 +0000 (14:32 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 8 Aug 2003 14:32:14 +0000 (14:32 +0000)
to application.

lib/doc/command_reply_args.html
lib/silcclient/command_reply.c

index e030614d70c5210c46ef85ce5e3dccc0d7491888..a45700218c249c83ca15083ed7fceb7db46bc0a5 100644 (file)
@@ -235,12 +235,16 @@ silc_client_get_clients_by_list function and pass the 'client_id_list' as
 argument to it.  The 'client_mode_list' includes 32-bit integers one after
 the other and they are in same order as clients in 'client_mode_list'.
 If application resolves the information with silc_client_get_clients_by_list
-parsing the 'client_mode_list' is not necessary.
+parsing the 'client_mode_list' is not necessary.  The 'founder_key' is the
+channel founder's key and may be NULL.  The 'channel_pubkeys' is Argument
+List Payload containing Public Key Payloads of all added channel public
+keys, it may be NULL.
 </td>
 <td width="50%"><small>char *channel_name, SilcChannelEntry channel,
 SilcUInt32 channel_mode, int ignored, SilcBuffer key_payload, NULL, NULL,
 char *topic, char *hmac_name, SilcUInt32 list_count, SilcBuffer client_id_list,
-SilcBuffer client_mode_list
+SilcBuffer client_mode_list, SilcPublicKey founder_key,
+SilcBuffer channel_pubkeys
 </td>
 </tr>
 
index 7d24d9fa051fcf56d8cdbb84d1bf8caa2c3afda0..e99abb2e219463b824dd18b89b3ec9f63dcb0347 100644 (file)
@@ -941,6 +941,8 @@ SILC_CLIENT_CMD_REPLY_FUNC(join)
   SilcUInt32 argc, mode = 0, len, list_count;
   char *topic, *tmp, *channel_name = NULL, *hmac;
   SilcBuffer keyp = NULL, client_id_list = NULL, client_mode_list = NULL;
+  SilcPublicKey founder_key = NULL;
+  SilcBufferStruct chpklist;
   int i;
 
   SILC_LOG_DEBUG(("Start"));
@@ -1098,22 +1100,30 @@ SILC_CLIENT_CMD_REPLY_FUNC(join)
   if (keyp && !(channel->mode & SILC_CHANNEL_MODE_PRIVKEY))
     silc_client_save_channel_key(cmd->client, conn, keyp, channel);
 
+  /* Get founder key */
+  tmp = silc_argument_get_arg_type(cmd->args, 15, &len);
+  if (tmp)
+    silc_pkcs_public_key_payload_decode(tmp, len, &founder_key);
+
+  /* Get channel public key list */
+  tmp = silc_argument_get_arg_type(cmd->args, 16, &len);
+  if (tmp)
+    silc_buffer_set(&chpklist, tmp, len);
+
   /* Notify application */
   COMMAND_REPLY((SILC_ARGS, channel_name, channel, mode, 0,
                 keyp ? keyp->head : NULL, NULL,
                 NULL, topic, hmac, list_count, client_id_list,
-                client_mode_list));
+                client_mode_list, founder_key, tmp ? &chpklist : NULL));
 
  out:
   SILC_CLIENT_PENDING_EXEC(cmd, SILC_COMMAND_JOIN);
   silc_client_command_reply_free(cmd);
-
-  if (keyp)
-    silc_buffer_free(keyp);
-  if (client_id_list)
-    silc_buffer_free(client_id_list);
-  if (client_mode_list)
-    silc_buffer_free(client_mode_list);
+  if (founder_key)
+    silc_pkcs_public_key_free(founder_key);
+  silc_buffer_free(keyp);
+  silc_buffer_free(client_id_list);
+  silc_buffer_free(client_mode_list);
 }
 
 /* Received reply for MOTD command */