[Telepathy-commits] [telepathy-salut/master] Caps: publish the right caps in txt records after the caps changed with SetSelfCapabilities

Alban Crequy alban.crequy at collabora.co.uk
Thu Feb 26 11:20:06 PST 2009


---
 lib/gibber/gibber-namespaces.h |    3 +++
 src/salut-connection.c         |    9 ++++++++-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/lib/gibber/gibber-namespaces.h b/lib/gibber/gibber-namespaces.h
index 466e968..6186cc9 100644
--- a/lib/gibber/gibber-namespaces.h
+++ b/lib/gibber/gibber-namespaces.h
@@ -23,6 +23,9 @@
 #define GIBBER_W3C_NS_XHTML \
   (const gchar *)"http://www.w3.org/1999/xhtml"
 
+#define GIBBER_TELEPATHY_NS_CAPS \
+  (const gchar *)"http://telepathy.freedesktop.org/caps"
+
 #define GIBBER_TELEPATHY_NS_TUBES \
   (const gchar *)"http://telepathy.freedesktop.org/xmpp/tubes"
 
diff --git a/src/salut-connection.c b/src/salut-connection.c
index c790558..eda637c 100644
--- a/src/salut-connection.c
+++ b/src/salut-connection.c
@@ -1767,6 +1767,7 @@ salut_connection_set_self_capabilities (
   guint i;
   GHashTable *save_caps;
   GError *error = NULL;
+  gchar *caps_hash;
 
   TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context);
 
@@ -1793,12 +1794,18 @@ salut_connection_set_self_capabilities (
         }
     }
 
-  if (!salut_self_set_caps (priv->self, "NODE", "HASH", "VER", &error))
+  /* XEP-0115 version 1.5 uses a verification string in the 'ver' attribute */
+  caps_hash = caps_hash_compute_from_self_presence (priv->self);
+
+  if (!salut_self_set_caps (priv->self, GIBBER_TELEPATHY_NS_CAPS, "sha-1",
+        caps_hash, &error))
     {
+      g_free (caps_hash);
       salut_presence_cache_free_cache_entry (save_caps);
       dbus_g_method_return_error (context, error);
       return;
     }
+  g_free (caps_hash);
 
   _emit_contact_capabilities_changed (self, base->self_handle,
                                       save_caps,
-- 
1.5.6.5




More information about the telepathy-commits mailing list