Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
- Copyright (C) 1997 - 2000 Pekka Riikonen
+ Copyright (C) 1997 - 2001 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
/* $Id$ */
#include "clientlibincludes.h"
+#include "client_internal.h"
/* Client command list. */
SilcClientCommand silc_command_list[] =
SILC_CLIENT_CMD(ping, PING, "PING", SILC_CF_LAG | SILC_CF_REG, 2),
SILC_CLIENT_CMD(oper, OPER, "OPER",
SILC_CF_LAG | SILC_CF_REG | SILC_CF_OPER, 2),
- SILC_CLIENT_CMD(join, JOIN, "JOIN", SILC_CF_LAG | SILC_CF_REG, 4),
+ SILC_CLIENT_CMD(join, JOIN, "JOIN", SILC_CF_LAG | SILC_CF_REG, 5),
SILC_CLIENT_CMD(motd, MOTD, "MOTD", SILC_CF_LAG | SILC_CF_REG, 2),
SILC_CLIENT_CMD(umode, UMODE, "UMODE", SILC_CF_LAG | SILC_CF_REG, 2),
SILC_CLIENT_CMD(cmode, CMODE, "CMODE", SILC_CF_LAG | SILC_CF_REG, 4),
cmd, FALSE, cmd->command->cmd)
/* Generic function to send any command. The arguments must be sent already
- encoded into correct form in correct order. */
+ encoded into correct form and in correct order. */
void silc_client_send_command(SilcClient client, SilcClientConnection conn,
SilcCommand command, unsigned short ident,
/* Duplicate Command Context by adding reference counter. The context won't
be free'd untill it hits zero. */
-SilcClientCommandContext
-silc_client_command_dup(SilcClientCommandContext ctx)
+SilcClientCommandContext silc_client_command_dup(SilcClientCommandContext ctx)
{
ctx->users++;
SILC_LOG_DEBUG(("Command context %p refcnt %d->%d", ctx, ctx->users - 1,
silc_client_command_free((SilcClientCommandContext)context);
}
+/* silc_client_get_client completion callback */
+void silc_client_command_completion(SilcClient client,
+ SilcClientConnection conn,
+ SilcClientEntry clients,
+ unsigned int clients_count,
+ void *context)
+{
+
+}
+
/* Command WHOIS. This command is used to query information about
specific user. */
}
/* Find channel entry */
- channel_entry = silc_idlist_get_channel(client, conn, cmd->argv[2]);
+ channel_entry = silc_client_get_channel(client, conn, cmd->argv[2]);
if (!channel_entry) {
cmd->client->ops->say(cmd->client, conn, "You are not on that channel");
COMMAND_ERROR;
/* Close connection */
q->client->ops->disconnect(q->client, q->conn);
- silc_client_close_connection(q->client, q->conn->sock);
+ silc_client_close_connection(q->client, q->conn->sock->user_data);
silc_free(q);
}
} else {
name = cmd->argv[1];
- channel = silc_idlist_get_channel(cmd->client, conn, name);
+ channel = silc_client_get_channel(cmd->client, conn, name);
if (!channel) {
cmd->client->ops->say(cmd->client, conn, "You are on that channel");
COMMAND_ERROR;
} else {
name = cmd->argv[1];
- channel = silc_idlist_get_channel(cmd->client, conn, name);
+ channel = silc_client_get_channel(cmd->client, conn, name);
if (!channel) {
cmd->client->ops->say(cmd->client, conn, "You are on that channel");
COMMAND_ERROR;
SilcClientConnection conn = cmd->conn;
SilcBuffer buffer;
unsigned char port[4];
+ unsigned int tmp;
if (!cmd->conn) {
SILC_NOT_CONNECTED(cmd->client, cmd->conn);
goto out;
}
- if (cmd->argc == 3)
- SILC_PUT32_MSB(atoi(cmd->argv[2]), port);
+ if (cmd->argc == 3) {
+ tmp = atoi(cmd->argv[2]);
+ SILC_PUT32_MSB(tmp, port);
+ }
if (cmd->argc == 3)
buffer = silc_command_payload_encode_va(SILC_COMMAND_CONNECT, 0, 2,
SilcClientConnection conn = cmd->conn;
SilcBuffer buffer;
unsigned char port[4];
+ unsigned int tmp;
if (!cmd->conn) {
SILC_NOT_CONNECTED(cmd->client, cmd->conn);
goto out;
}
- if (cmd->argc == 3)
- SILC_PUT32_MSB(atoi(cmd->argv[2]), port);
+ if (cmd->argc == 3) {
+ tmp = atoi(cmd->argv[2]);
+ SILC_PUT32_MSB(tmp, port);
+ }
if (cmd->argc == 3)
buffer = silc_command_payload_encode_va(SILC_COMMAND_CLOSE, 0, 2,