updates.
[silc.git] / apps / silcd / command_reply.c
index 7086cc17a4b87064ef0658177882f9ba967d80f7..60e9f9f76c1b9fe0ca41843ec219f63c35172611 100644 (file)
@@ -376,6 +376,7 @@ SILC_SERVER_CMD_REPLY_FUNC(join)
   SilcCommandStatus status;
   SilcChannelID *id;
   SilcChannelEntry entry;
+  SilcHmac hmac = NULL;
   unsigned int id_len, len;
   unsigned char *id_string;
   char *channel_name, *tmp;
@@ -420,6 +421,13 @@ SILC_SERVER_CMD_REPLY_FUNC(join)
   if (!id)
     goto out;
 
+  /* Get hmac */
+  tmp = silc_argument_get_arg_type(cmd->args, 10, NULL);
+  if (tmp) {
+    if (!silc_hmac_alloc(tmp, NULL, &hmac))
+      goto out;
+  }
+
   /* See whether we already have the channel. */
   entry = silc_idlist_find_channel_by_id(server->local_list, id, NULL);
   if (!entry) {
@@ -432,7 +440,7 @@ SILC_SERVER_CMD_REPLY_FUNC(join)
     /* Add the channel to our local list. */
     entry = silc_idlist_add_channel(server->local_list, strdup(channel_name), 
                                    SILC_CHANNEL_MODE_NONE, id, 
-                                   server->router, NULL);
+                                   server->router, NULL, hmac);
     if (!entry) {
       silc_free(id);
       goto out;