diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/command/cmd_ac.c | 28 | ||||
-rw-r--r-- | src/command/cmd_funcs.c | 7 | ||||
-rw-r--r-- | src/xmpp/message.c | 8 | ||||
-rw-r--r-- | src/xmpp/ox.c | 6 |
4 files changed, 23 insertions, 26 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index ac4e3726..83721f02 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -882,7 +882,6 @@ cmd_ac_init(void) autocomplete_add(pgp_sendfile_ac, "on"); autocomplete_add(pgp_sendfile_ac, "off"); - // XEP-0373: OX ox_ac = autocomplete_new(); autocomplete_add(ox_ac, "keys"); autocomplete_add(ox_ac, "contacts"); @@ -1443,6 +1442,7 @@ cmd_ac_reset(ProfWin* window) autocomplete_reset(pgp_ac); autocomplete_reset(pgp_log_ac); autocomplete_reset(pgp_sendfile_ac); + autocomplete_reset(ox_ac); #endif autocomplete_reset(tls_ac); autocomplete_reset(titlebar_ac); @@ -1604,6 +1604,9 @@ cmd_ac_uninit(void) autocomplete_free(pgp_ac); autocomplete_free(pgp_log_ac); autocomplete_free(pgp_sendfile_ac); + autocomplete_free(ox_ac); + autocomplete_free(ox_log_ac); + autocomplete_free(ox_sendfile_ac); #endif autocomplete_free(tls_ac); autocomplete_free(titlebar_ac); @@ -2580,6 +2583,11 @@ _ox_autocomplete(ProfWin* window, const char* const input, gboolean previous) { char* found = NULL; + found = autocomplete_param_with_ac(input, "/ox", ox_ac, TRUE, previous); + if (found) { + return found; + } + jabber_conn_status_t conn_status = connection_get_status(); if (conn_status == JABBER_CONNECTED) { @@ -2587,13 +2595,16 @@ _ox_autocomplete(ProfWin* window, const char* const input, gboolean previous) if (found) { return found; } - } - if (conn_status == JABBER_CONNECTED) { found = autocomplete_param_with_func(input, "/ox discover", roster_contact_autocomplete, previous, NULL); if (found) { return found; } + + found = autocomplete_param_with_func(input, "/ox setkey", roster_barejid_autocomplete, previous, NULL); + if (found) { + return found; + } } found = autocomplete_param_with_ac(input, "/ox log", ox_log_ac, TRUE, previous); @@ -2610,16 +2621,7 @@ _ox_autocomplete(ProfWin* window, const char* const input, gboolean previous) return cmd_ac_complete_filepath(input, "/ox announce", previous); } - if (conn_status == JABBER_CONNECTED) { - found = autocomplete_param_with_func(input, "/ox setkey", roster_barejid_autocomplete, previous, NULL); - if (found) { - return found; - } - } - - found = autocomplete_param_with_ac(input, "/ox", ox_ac, TRUE, previous); - - return found; + return NULL; } #endif diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index fccb937e..ebba224e 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -7513,11 +7513,6 @@ cmd_pgp(ProfWin* window, const char* const command, gchar** args) #ifdef HAVE_LIBGPGME -/*! - * \brief Command for XEP-0373: OpenPGP for XMPP - * - */ - gboolean cmd_ox(ProfWin* window, const char* const command, gchar** args) { @@ -7710,7 +7705,7 @@ cmd_ox(ProfWin* window, const char* const command, gchar** args) cons_show("JID and OpenPGP Key ID are required"); } } else { - cons_show("OX not implemented"); + cons_bad_cmd_usage(command); } return TRUE; } diff --git a/src/xmpp/message.c b/src/xmpp/message.c index 6ced48f7..c18f9376 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -1452,16 +1452,13 @@ _handle_chat(xmpp_stanza_t* const stanza, gboolean is_mam, gboolean is_carbon, c // 0085 works only with resource if (jid->resourcepart) { - // XEP-0085: Chat State Notifications + // XEP-0085: Chat Stase Notifications _handle_chat_states(stanza, jid); } message_free(message); } -/*! - * @brief Handle incoming XMMP-OX chat message. - */ static void _handle_ox_chat(xmpp_stanza_t* const stanza, ProfMessage* message, gboolean is_mam) { @@ -1482,8 +1479,7 @@ _handle_ox_chat(xmpp_stanza_t* const stanza, ProfMessage* message, gboolean is_m } xmpp_stanza_t* b = xmpp_stanza_get_child_by_name(p, "body"); if (!b) { - log_warning("OX Stanza - no body"); - message->plain = "OX error: No payload body found"; + log_debug("OX Stanza - no body"); return; } message->plain = xmpp_stanza_get_text(b); diff --git a/src/xmpp/ox.c b/src/xmpp/ox.c index f43fbd60..0fa5cece 100644 --- a/src/xmpp/ox.c +++ b/src/xmpp/ox.c @@ -340,7 +340,11 @@ _ox_request_public_key(const char* const jid, const char* const fingerprint) { assert(jid); assert(fingerprint); - assert(strlen(fingerprint) == KEYID_LENGTH); + + if (strlen(fingerprint) != KEYID_LENGTH) { + cons_show_error("Invalid fingerprint length for: %s", fingerprint); + } + cons_show("Requesting Public Key %s for %s", fingerprint, jid); log_info("[OX] Request %s's public key %s.", jid, fingerprint); // iq |