Added prof_send_stanza to plugins API

This commit is contained in:
James Booth
2016-03-23 22:57:03 +00:00
parent 503fc9e393
commit 4c913aa08b
10 changed files with 61 additions and 6 deletions

View File

@@ -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)

View File

@@ -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;
}

View File

@@ -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);