stanza: add xmpp_stanza_get_context()

This function is backported from UnrealEngine project.
This commit is contained in:
Dmitry Podgorny
2020-01-07 22:13:39 +02:00
parent 2272681ea2
commit cecd6b20e8
3 changed files with 16 additions and 0 deletions

View File

@@ -6,6 +6,7 @@
- xmpp_conn_is_connecting()
- xmpp_conn_is_connected()
- xmpp_conn_is_disconnected()
- xmpp_stanza_get_context()
0.9.3
- PLAIN mechanism is used only when no other mechanisms are supported

View File

@@ -188,6 +188,19 @@ int xmpp_stanza_release(xmpp_stanza_t * const stanza)
return released;
}
/** Get the strophe context that the stanza is associated with.
*
* @param stanza a Strophe stanza object
*
* @return a Strophe context
*
* @ingroup Stanza
*/
xmpp_ctx_t *xmpp_stanza_get_context(const xmpp_stanza_t * const stanza)
{
return stanza->ctx;
}
/** Determine if a stanza is a text node.
*
* @param stanza a Strophe stanza object

View File

@@ -326,6 +326,8 @@ xmpp_stanza_t *xmpp_stanza_copy(const xmpp_stanza_t * const stanza);
/* free a stanza object and it's contents */
int xmpp_stanza_release(xmpp_stanza_t * const stanza);
xmpp_ctx_t *xmpp_stanza_get_context(const xmpp_stanza_t * const stanza);
int xmpp_stanza_is_text(xmpp_stanza_t * const stanza);
int xmpp_stanza_is_tag(xmpp_stanza_t * const stanza);