From 26d160cae861865191150c73853a748fcd9cfad1 Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 29 Sep 2015 00:01:38 +0100 Subject: WIP: Added last activity request and response --- src/command/commands.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/command/commands.c') diff --git a/src/command/commands.c b/src/command/commands.c index e6d1e277..6b301057 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -3261,6 +3261,31 @@ cmd_disco(ProfWin *window, const char * const command, gchar **args) return TRUE; } +gboolean +cmd_lastactivity(ProfWin *window, const char * const command, gchar **args) +{ + jabber_conn_status_t conn_status = jabber_get_connection_status(); + + if (conn_status != JABBER_CONNECTED) { + cons_show("You are not currenlty connected."); + return TRUE; + } + + if (args[0] == NULL) { + Jid *jidp = jid_create(jabber_get_fulljid()); + GString *jid = g_string_new(jidp->domainpart); + + iq_last_activity_request(jid->str); + + g_string_free(jid, TRUE); + jid_destroy(jidp); + } else { + iq_last_activity_request(args[0]); + } + + return TRUE; +} + gboolean cmd_nick(ProfWin *window, const char * const command, gchar **args) { -- cgit 1.4.1-2-gfad0