Added new stanza for error responce, libstrophe now will be responce <stream:error> if parser failed

This commit is contained in:
Ilya Orlov
2017-09-04 11:46:09 +03:00
parent d0644c5e95
commit 032e8ec89d
6 changed files with 132 additions and 6 deletions

View File

@@ -73,6 +73,15 @@ static int _conn_connect(xmpp_conn_t * const conn,
xmpp_conn_handler callback,
void * const userdata);
void xmpp_send_error(xmpp_conn_t * const conn, xmpp_error_type_t const type, char * const text)
{
xmpp_stanza_t *error = xmpp_error_new(conn->ctx, type, text);
xmpp_send(conn, error);
xmpp_stanza_release(error);
}
/** Create a new Strophe connection object.
*
* @param ctx a Strophe context object