about summary refs log tree commit diff stats
path: root/src/xmpp/capabilities.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmpp/capabilities.c')
-rw-r--r--src/xmpp/capabilities.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/xmpp/capabilities.c b/src/xmpp/capabilities.c
index db840246..358f6bff 100644
--- a/src/xmpp/capabilities.c
+++ b/src/xmpp/capabilities.c
@@ -57,6 +57,7 @@
 #include "xmpp/stanza.h"
 #include "xmpp/form.h"
 #include "xmpp/capabilities.h"
+#include "plugins/plugins.h"
 
 static gchar *cache_loc;
 static GKeyFile *cache;
@@ -552,6 +553,15 @@ caps_get_my_sha1(xmpp_ctx_t *const ctx)
     return my_sha1;
 }
 
+void
+caps_reset_ver(void)
+{
+    if (my_sha1) {
+        g_free(my_sha1);
+        my_sha1 = NULL;
+    }
+}
+
 xmpp_stanza_t*
 caps_create_query_response_stanza(xmpp_ctx_t *const ctx)
 {
@@ -632,6 +642,18 @@ caps_create_query_response_stanza(xmpp_ctx_t *const ctx)
     xmpp_stanza_add_child(query, feature_ping);
     xmpp_stanza_add_child(query, feature_receipts);
 
+    GList *plugin_features = plugins_get_disco_features();
+    GList *curr = plugin_features;
+    while (curr) {
+        xmpp_stanza_t *feature = xmpp_stanza_new(ctx);
+        xmpp_stanza_set_name(feature, STANZA_NAME_FEATURE);
+        xmpp_stanza_set_attribute(feature, STANZA_ATTR_VAR, curr->data);
+        xmpp_stanza_add_child(query, feature);
+        xmpp_stanza_release(feature);
+
+        curr = g_list_next(curr);
+    }
+
     xmpp_stanza_release(feature_receipts);
     xmpp_stanza_release(feature_ping);
     xmpp_stanza_release(feature_conference);