SILC_CHANNEL_REC *rec;
rec = silc_channel_find(server, channel);
- if (rec == NULL)
+ if (rec == NULL || rec->entry == NULL)
return;
silc_client_send_channel_message(silc_client, server->conn, rec->entry,
return ret;
}
+/* Syntaxes of all SILC commands for HELP files (the help file generation
+ will snoop these from here). */
+
+/* SYNTAX: BAN <channel> [+|-[<nickname>[@<server>[!<username>[@hostname>]]]]] */
+/* SYNTAX: CMODE <channel> +|-<modes> [{ <arguments>}] */
+/* SYNTAX: CUMODE <channel> +|-<modes> <nickname>[@<server>] [-pubkey|<passwd>] */
+/* SYNTAX: GETKEY <nickname or server name> */
+/* SYNTAX: INVITE <channel> [<nickname>[@server>] */
+/* SYNTAX: INVITE <channel> [+|-[<nickname>[@<server>[!<username>[@hostname>]]]]] */
+/* SYNTAX: KEY MSG <nickname> set|unset|list|agreement|negotiate [<arguments>] */
+/* SYNTAX: KEY CHANNEL <channel> set|unset|list|agreement|negotiate [<arguments>] */
+/* SYNTAX: KICK <channel> <nickname>[@<server>] [<comment>] */
+/* SYNTAX: KILL <channel> <nickname>[@<server>] [<comment>] */
+/* SYNTAX: OPER <username> [-pubkey] */
+/* SYNTAX: SILCOPER <username> [-pubkey] */
+/* SYNTAX: TOPIC <channel> [<topic>] */
+/* SYNTAX: UMODE +|-<modes> */
+/* SYNTAX: WHOIS <nickname>[@<server>] [<count>] */
+/* SYNTAX: WHOWAS <nickname>[@<server>] [<count>] */
+/* SYNTAX: CLOSE <server> [<port>] */
+/* SYNTAX: SHUTDOWN */
+/* SYNTAX: MOTD [<server>] */
+/* SYNTAX: LIST [<channel>] */
+/* SYNTAX: ME <message> */
+/* SYNTAX: ACTION <channel> <message> */
+/* SYNTAX: AWAY [<message>] */
+/* SYNTAX: INFO [<server>] */
+/* SYNTAX: NICK <nickname> */
+/* SYNTAX: NOTICE <message> */
+/* SYNTAX: PART [<channel>] */
+/* SYNTAX: PING */
+/* SYNTAX: SCONNECT <server> [<port>] */
+/* SYNTAX: USERS <channel> */
+
void silc_command_exec(SILC_SERVER_REC *server,
const char *command, const char *args)
{
ctx->argv_types = argv_types;
/* Execute command */
- (*cmd->cb)(ctx);
+ (*cmd->cb)(ctx, NULL);
}
/* Generic command function to call any SILC command directly. */
-static void command_self(const char *data, SILC_SERVER_REC *server)
+static void command_self(const char *data, SILC_SERVER_REC *server,
+ WI_ITEM_REC *item)
{
if (!IS_SILC_SERVER(server) || !server->connected) {
printtext(NULL, NULL, MSGLEVEL_CLIENTERROR, "Not connected to server");
return;
}
+ if (IS_SILC_CHANNEL(item)) {
+ SILC_CHANNEL_REC *chanrec;
+ chanrec = silc_channel_find(server, item->name);
+ if (chanrec)
+ server->conn->current_channel = chanrec->entry;
+ }
+
silc_command_exec(server, current_command, data);
signal_stop();
}