Added /ping command

This commit is contained in:
James Booth
2014-09-04 01:08:10 +01:00
parent b50b786dcc
commit 4ba33cb13c
9 changed files with 86 additions and 4 deletions

View File

@@ -2576,6 +2576,26 @@ cmd_autoping(gchar **args, struct cmd_help_t help)
return TRUE;
}
gboolean
cmd_ping(gchar **args, struct cmd_help_t help)
{
jabber_conn_status_t conn_status = jabber_get_connection_status();
if (conn_status != JABBER_CONNECTED) {
cons_show("You are not currenlty connected.");
return TRUE;
}
iq_send_ping(args[0]);
if (args[0] == NULL) {
cons_show("Pinged server...");
} else {
cons_show("Pinged %s...", args[0]);
}
return TRUE;
}
gboolean
cmd_autoaway(gchar **args, struct cmd_help_t help)
{