diff options
author | James Booth <boothj5@gmail.com> | 2013-01-21 22:05:30 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-01-21 22:05:30 +0000 |
commit | 745786434738a9626aa813028ae107f17a2197e2 (patch) | |
tree | 41f098da9dfe9c1c2f74bb173787694d1425e6c3 /src/stanza.c | |
parent | df38fc332a2593514cb94c9a632e522f11c5583e (diff) | |
download | profani-tty-745786434738a9626aa813028ae107f17a2197e2.tar.gz |
Added software version capability and iq response
Diffstat (limited to 'src/stanza.c')
-rw-r--r-- | src/stanza.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/stanza.c b/src/stanza.c index dd71d277..5e90cf90 100644 --- a/src/stanza.c +++ b/src/stanza.c @@ -432,6 +432,34 @@ stanza_contains_caps(xmpp_stanza_t * const stanza) } gboolean +stanza_is_version_request(xmpp_stanza_t * const stanza) +{ + char *type = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_TYPE); + + if (g_strcmp0(type, STANZA_TYPE_GET) != 0) { + return FALSE; + } + + xmpp_stanza_t *query = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_QUERY); + + if (query == NULL) { + return FALSE; + } + + char *ns = xmpp_stanza_get_ns(query); + + if (ns == NULL) { + return FALSE; + } + + if (strcmp(ns, STANZA_NS_VERSION) != 0) { + return FALSE; + } + + return TRUE; +} + +gboolean stanza_is_caps_request(xmpp_stanza_t * const stanza) { char *type = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_TYPE); |