Added software version capability and iq response

This commit is contained in:
James Booth
2013-01-21 22:05:30 +00:00
parent df38fc332a
commit 7457864347
3 changed files with 99 additions and 5 deletions

View File

@@ -431,6 +431,34 @@ stanza_contains_caps(xmpp_stanza_t * const stanza)
return TRUE;
}
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)
{