Command reply fixes.
authorPekka Riikonen <priikone@silcnet.org>
Tue, 10 Feb 2004 16:29:10 +0000 (16:29 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 10 Feb 2004 16:29:10 +0000 (16:29 +0000)
apps/silcd/command.c
apps/silcd/server_util.c

index 265dead7ea1509a5e1676dd8b5773a426dfd1a20..bb56e807b151ba4b0e7daf2feb1f300241db50f6 100644 (file)
@@ -1866,9 +1866,11 @@ static void silc_server_command_join_channel(SilcServer server,
                                      &resolve);
     if (!client) {
       if (!resolve || cmd->pending) {
-       silc_server_command_send_status_reply(
+       tmp = silc_argument_get_arg_type(cmd->args, 2, &tmp_len);
+       silc_server_command_send_status_data(
                                         cmd, SILC_COMMAND_JOIN,
-                                        SILC_STATUS_ERR_NOT_ENOUGH_PARAMS, 0);
+                                        SILC_STATUS_ERR_NO_SUCH_CLIENT_ID, 0,
+                                        2, tmp, tmp_len);
        goto out;
       }
 
@@ -1979,9 +1981,6 @@ static void silc_server_command_join_channel(SilcServer server,
                   cmd->sock->hostname, strlen(cmd->sock->hostname));
     }
 
-    SILC_LOG_DEBUG(("check : %s", check));
-    SILC_LOG_DEBUG(("check2: %s", check2));
-
     /* Check invite list if channel is invite-only channel */
     if (channel->mode & SILC_CHANNEL_MODE_INVITE) {
       if (!channel->invite_list ||
@@ -2323,15 +2322,15 @@ SILC_SERVER_CMD_FUNC(join)
   tmp = silc_argument_get_arg_type(cmd->args, 2, &tmp_len);
   if (!tmp) {
     silc_server_command_send_status_reply(cmd, SILC_COMMAND_JOIN,
-                                         SILC_STATUS_ERR_NOT_ENOUGH_PARAMS,
+                                         SILC_STATUS_ERR_NO_CLIENT_ID,
                                          0);
     goto out;
   }
   client_id = silc_id_payload_parse_id(tmp, tmp_len, NULL);
   if (!client_id) {
-    silc_server_command_send_status_reply(cmd, SILC_COMMAND_JOIN,
-                                         SILC_STATUS_ERR_NOT_ENOUGH_PARAMS,
-                                         0);
+    silc_server_command_send_status_data(cmd, SILC_COMMAND_JOIN,
+                                        SILC_STATUS_ERR_BAD_CLIENT_ID, 0,
+                                        2, tmp, tmp_len);
     goto out;
   }
 
index 4e3d0a07b889b7dd96f5a57c77f815d7fb91af6e..8e545578717d506a75e693bd27aa12dc17e5c564 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2003 Pekka Riikonen
+  Copyright (C) 1997 - 2004 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -119,6 +119,7 @@ silc_server_remove_clients_channels(SilcServer server,
       silc_hash_table_add(channels, channel, channel);
   }
   silc_hash_table_list_reset(&htl);
+  assert(!silc_hash_table_count(client->channels));
 }
 
 /* This function removes all client entries that are originated from
@@ -1024,6 +1025,7 @@ bool silc_server_channel_delete(SilcServer server,
 
     /* Totally delete the channel and all users on the channel. The
        users are deleted automatically in silc_idlist_del_channel. */
+    channel->disabled = TRUE;
     silc_schedule_task_del_by_context(server->schedule, channel->rekey);
     if (silc_idlist_del_channel(server->local_list, channel)) {
       server->stat.my_channels--;