q->client = cmd->client;
q->conn = cmd->conn;
+ /* Sleep for a while */
+ sleep(2);
+
/* We quit the connection with little timeout */
silc_schedule_task_add(cmd->client->schedule, cmd->conn->sock->sock,
silc_client_command_quit_cb, (void *)q,
}
/* Get the current mode */
+ silc_list_start(channel->clients);
while ((chu = silc_list_get(channel->clients)) != SILC_LIST_END) {
if (chu->client == client_entry) {
mode = chu->mode;
/* Send the command packet. We support sending only one mode at once
that requires an argument. */
- buffer = silc_command_payload_encode_va(SILC_COMMAND_CUMODE, 0, 4,
+ buffer = silc_command_payload_encode_va(SILC_COMMAND_CUMODE, 0,
+ auth ? 4 : 3,
1, chidp->data, chidp->len,
2, modebuf, 4,
3, clidp->data, clidp->len,
/* Check whether user requested server actually */
server_entry = silc_client_get_server(client, conn, cmd->argv[1]);
- if (!server_entry && !cmd->pending) {
+ if (!server_entry) {
+ if (cmd->pending) {
+ COMMAND_ERROR;
+ goto out;
+ }
+
/* No. what ever user wants we don't have it, so resolve it. We
will try to resolve both client and server, one of them is
bound to be wrong. */