diff options
Diffstat (limited to 'src/xmpp')
-rw-r--r-- | src/xmpp/connection.c | 11 | ||||
-rw-r--r-- | src/xmpp/iq.c | 12 | ||||
-rw-r--r-- | src/xmpp/xmpp.h | 1 |
3 files changed, 18 insertions, 6 deletions
diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c index 35fd9938..b70614de 100644 --- a/src/xmpp/connection.c +++ b/src/xmpp/connection.c @@ -480,6 +480,17 @@ jabber_conn_is_secured(void) } } +gboolean +jabber_send_stanza(const char *const stanza) +{ + if (jabber_conn.conn_status != JABBER_CONNECTED) { + return FALSE; + } else { + xmpp_send_raw(jabber_conn.conn, stanza, strlen(stanza)); + return TRUE; + } +} + static jabber_conn_status_t _jabber_connect(const char *const fulljid, const char *const passwd, const char *const altdomain, int port, const char *const tls_policy) diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c index c2c56cd6..7a052633 100644 --- a/src/xmpp/iq.c +++ b/src/xmpp/iq.c @@ -637,13 +637,13 @@ _caps_response_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, } if (query == NULL) { - log_warning("No query element found."); + log_info("No query element found."); return 0; } char *node = xmpp_stanza_get_attribute(query, STANZA_ATTR_NODE); if (node == NULL) { - log_warning("No node attribute found"); + log_info("No node attribute found"); return 0; } @@ -715,14 +715,14 @@ _caps_response_handler_for_jid(xmpp_conn_t *const conn, xmpp_stanza_t *const sta } if (query == NULL) { - log_warning("No query element found."); + log_info("No query element found."); free(jid); return 0; } char *node = xmpp_stanza_get_attribute(query, STANZA_ATTR_NODE); if (node == NULL) { - log_warning("No node attribute found"); + log_info("No node attribute found"); free(jid); return 0; } @@ -774,14 +774,14 @@ _caps_response_handler_legacy(xmpp_conn_t *const conn, xmpp_stanza_t *const stan } if (query == NULL) { - log_warning("No query element found."); + log_info("No query element found."); free(expected_node); return 0; } char *node = xmpp_stanza_get_attribute(query, STANZA_ATTR_NODE); if (node == NULL) { - log_warning("No node attribute found"); + log_info("No node attribute found"); free(expected_node); return 0; } diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h index 7e3a2c84..8a7d4850 100644 --- a/src/xmpp/xmpp.h +++ b/src/xmpp/xmpp.h @@ -159,6 +159,7 @@ void jabber_free_uuid(char *uuid); TLSCertificate* jabber_get_tls_peer_cert(void); #endif gboolean jabber_conn_is_secured(void); +gboolean jabber_send_stanza(const char *const stanza); // message functions char* message_send_chat(const char *const barejid, const char *const msg); |