Add command command
Initial commit to test commands API
This commit is contained in:
@@ -7469,6 +7469,29 @@ cmd_encwarn(ProfWin *window, const char *const command, gchar **args)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
cmd_command(ProfWin *window, const char *const command, gchar **args)
|
||||
{
|
||||
jabber_conn_status_t conn_status = connection_get_status();
|
||||
|
||||
if (conn_status != JABBER_CONNECTED) {
|
||||
cons_show("You are not currently connected.");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (args[0] == NULL && connection_supports(XMPP_FEATURE_COMMANDS) == FALSE) {
|
||||
cons_show("Server does not support ad hoc commands.");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
ProfMucWin *mucwin = (ProfMucWin*)window;
|
||||
|
||||
iq_send_command(mucwin->roomjid, args[0]);
|
||||
|
||||
cons_show("Execute %s...", args[0]);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_cmd_execute(ProfWin *window, const char *const command, const char *const inp)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user