Added stanza_add_child
This commit is contained in:
@@ -61,7 +61,7 @@ end_element(void *data, const char *element)
|
|||||||
depth--;
|
depth--;
|
||||||
|
|
||||||
if (depth > 0) {
|
if (depth > 0) {
|
||||||
curr_stanza->parent->children = g_list_append(curr_stanza->parent->children, curr_stanza);
|
stanza_add_child(curr_stanza->parent, curr_stanza);
|
||||||
curr_stanza = curr_stanza->parent;
|
curr_stanza = curr_stanza->parent;
|
||||||
} else {
|
} else {
|
||||||
stanza_add(curr_stanza);
|
stanza_add(curr_stanza);
|
||||||
|
|||||||
@@ -52,3 +52,9 @@ stanza_add(XMPPStanza *stanza)
|
|||||||
{
|
{
|
||||||
stanzas = g_list_append(stanzas, stanza);
|
stanzas = g_list_append(stanzas, stanza);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
stanza_add_child(XMPPStanza *parent, XMPPStanza *child)
|
||||||
|
{
|
||||||
|
parent->children = g_list_append(parent->children, child);
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,5 +17,6 @@ typedef struct xmpp_stanza_t {
|
|||||||
void stanza_show(XMPPStanza *stanza);
|
void stanza_show(XMPPStanza *stanza);
|
||||||
void stanza_show_all(void);
|
void stanza_show_all(void);
|
||||||
void stanza_add(XMPPStanza *stanza);
|
void stanza_add(XMPPStanza *stanza);
|
||||||
|
void stanza_add_child(XMPPStanza *parent, XMPPStanza *child);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user