about summary refs log tree commit diff stats
path: root/src/stanza.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stanza.c')
-rw-r--r--src/stanza.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/stanza.c b/src/stanza.c
index e27aa40d..3abc0abd 100644
--- a/src/stanza.c
+++ b/src/stanza.c
@@ -415,6 +415,22 @@ stanza_get_idle_time(xmpp_stanza_t * const stanza)
     }
 }
 
+gboolean
+stanza_contains_caps(xmpp_stanza_t * const stanza)
+{
+    xmpp_stanza_t *caps = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_C);
+
+    if (caps == NULL) {
+        return FALSE;
+    }
+
+    if (strcmp(xmpp_stanza_get_ns(caps), STANZA_NS_CAPS) != 0) {
+        return FALSE;
+    }
+
+    return TRUE;
+}
+
 char *
 stanza_get_caps_str(xmpp_stanza_t * const stanza)
 {